#PB_any mit WinApi
Verfasst: 24.08.2006 23:46
Hallo wie kann ich eine ID für CreateWindowEx ermitteln die noch nicht existiert?
Code: Alles auswählen
; HWND CreateWindowEx( DWORD dwExStyle,
; LPCTSTR lpClassName,
; LPCTSTR lpWindowName,
; DWORD dwStyle,
; int x,
; int y,
; int nWidth,
; int nHeight,
; HWND hWndParent,
; HMENU hMenu,
; HINSTANCE hInstance,
; LPVOID lpParam
; );
Global Button1.l, hWndParent.l, hInstance.l
Procedure MyWindowCallback(WindowID, Message, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
Select Message
Case #WM_COMMAND
Select lParam
Case Button1
Debug "Button1"
EndSelect
EndSelect
ProcedureReturn Result
EndProcedure
If OpenWindow(0, #PB_Ignore, 0, 150, 50, "TestFenster")
hWndParent = WindowID(0) ; Parent ist das Hauptfenster
hInstance = GetModuleHandle_(0)
Button1 = CreateWindowEx_(#Null, "Button", "Drück mich", #WS_CHILD | #WS_VISIBLE, 35, 10, 80, 25, hWndParent, 0, hInstance, #Null)
SetWindowCallback(@MyWindowCallback(), 0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
hMenu ist normallerweise #NULLKonne hat geschrieben:Mit ID meine ich:
HMENU hMenu,