Thema: Delphi How to hide Startmenu

Einzelnen Beitrag anzeigen

Benutzerbild von jfheins
jfheins

Registriert seit: 10. Jun 2004
Ort: Garching (TUM)
4.579 Beiträge
 
#7

Re: How to hide Startmenu

  Alt 19. Okt 2008, 15:13
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"
  Mit Zitat antworten Zitat