Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi How to hide Startmenu (https://www.delphipraxis.net/122615-how-hide-startmenu.html)

Razor 19. Okt 2008 13:51


How to hide Startmenu
 
How to do it?Startmenu not the startbutton thats a big diffrence..
Becouse i want to create a replacement..

thanks...

jfheins 19. Okt 2008 13:58

Re: How to hide Startmenu
 
You could try to redirect the messages of the button.

IOW:

YourVariable := MessageLoopOfStartButton;
MessageLoopOfStartbutton := YourCustomMessageLoop;

In YourCustomMessageLoop you can pass every message to the former message-loop except for the click-message, which you can handle yourself. This way, the button will never notice when the user clicks it ;)

Razor 19. Okt 2008 13:59

Re: How to hide Startmenu
 
Danke,danke:D I will try this..I am making longhorn startmenu for vista..

jfheins 19. Okt 2008 14:04

Re: How to hide Startmenu
 
Zitat:

Zitat von Razor
Danke,danke:D I will try this..I am making longhorn startmenu for vista..

Correct me if I'm wrong but ... Longhorn is Vista (or the former name of vista) isn't it?

Razor 19. Okt 2008 14:05

Re: How to hide Startmenu
 
Yes i messed it up a bit i mean Longhorn 4074 :P.Vista is 6001(SP1)

Razor 19. Okt 2008 14:37

Re: How to hide Startmenu
 
Could you make an example? :-D

jfheins 19. Okt 2008 15:13

Re: How to hide Startmenu
 
An example ...... i can show you how to do it ;)
(As I have no Delphi installed I dunno if it compiles ...)

First, you need a variable that holds the old WndProc. A Pointer should do the job.

To get the pointer to the WndProc you can call GetWindowLong(), to process the messages in your program, you need a seperate function
Delphi-Quellcode:
var
  OldWndProc: Pointer;

begin // Change WndProc
  OldWndProc := GetWindowLong({Handle to the Button}, GWLP_WNDPROC);
  SetWindowLong({Handle to the Button}, GWLP_WNDPROC, @NewWndProc);
end;

function NewWndProc(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
begin
  if ({The Message you want})
    // Handle Message
  else // Call old WndProc
    CallWindowProc(OldWndProc, hWnd, uMsg, wParam, lParam);
end;
Something like that ;)

To get the Handle of the button, you can use FindWindow.

You can find additional stuff by searching for "subclassing" ;)

Apollonius 19. Okt 2008 15:17

Re: How to hide Startmenu
 
You don't even need GetWindowLong. SetWindowLong returns the previous value of the specified attribute. You also avoid a possible race condition if you remove the call.
Note that changing the WndProc only works for Vista. According to the documentation you can't set a new one for a window in a different process.

Razor 19. Okt 2008 15:40

Re: How to hide Startmenu
 
Liste der Anhänge anzeigen (Anzahl: 1)
I made something :-D

Razor 19. Okt 2008 20:30

Re: How to hide Startmenu
 
New question> What if i disable the start button and make my own?


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:03 Uhr.
Seite 1 von 3  1 23      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz