Einzelnen Beitrag anzeigen

Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#4

Re: MessageBoxIndirect eigenes Symbol

  Alt 29. Aug 2006, 20:04
Wenn du dein Icon über einen Index einbindest (Mainicon ist meine ich 1), dann kannst du das verwenden:
Delphi-Quellcode:
function MyMessageBox(hWnd: HWND; Text, Caption: String; IconID: DWORD;
  const Buttons: Cardinal = MB_OK): Integer;
var MsgInfo: TMsgBoxParams;
begin
  With MsgInfo do
  begin
    cbSize := SizeOf(TMsgBoxParams);
    dwContextHelpId := 0;
    dwLanguageId := LANG_NEUTRAL;
    dwStyle := Buttons or MB_USERICON or MB_APPLMODAL;
    hInstance := GetWindowLong(hWnd, GWL_HINSTANCE);
    hwndOwner := hWnd;
    lpfnMsgBoxCallback := nil;
    lpszCaption := @Caption[1];
    lpszIcon := MAKEINTRESOURCE(IconID);
    lpszText := @Text[1];
  end;
  Result := Integer(MessageBoxIndirect(MsgInfo));
end;
Florian
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat