
Merci
Code : Tout sélectionner
Procedure WindowCallback(Window, Message, wParam, lParam)
Select Message
Case #WM_CLOSE
If MessageBox_(Window, "Wirklich beenden?", "EXIT", #MB_YESNO) = #IDYES
DestroyWindow_(Window)
Else
Result = 0
EndIf
Case #WM_DESTROY
PostQuitMessage_(0)
Result = 0
Default
Result = DefWindowProc_(Window, Message, wParam, lParam)
EndSelect
ProcedureReturn Result
EndProcedure
#Style = #WS_VISIBLE | #WS_BORDER | #WS_SYSMENU
#StyleEx = #WS_EX_TOOLWINDOW ;| #WS_EX_OVERLAPPEDWINDOW
WindowClass.s = "MeinFenster"
wc.WNDCLASSEX
wc\cbSize = SizeOf(WNDCLASSEX)
wc\lpfnWndProc = @WindowCallback()
wc\hCursor = LoadCursor_(0, #IDC_CROSS); #IDC_ARROW = Arrow
; #IDC_SIZEALL = Size Arrow
; #IDC_CROSS = Cross
wc\hbrBackground = #COLOR_WINDOW + 1;CreateSolidBrush_(RGB($8F,$8F,$8F))
wc\lpszClassName = @WindowClass
RegisterClassEx_(@wc)
hWndMain = CreateWindowEx_(#StyleEx, WindowClass, "Test-Window", #Style, 10, 10, 200, 200, 0, 0, 0, 0)
CreateWindowEx_(0, "Static", "", #WS_CHILD | #WS_VISIBLE | $12, 9, 9, 102, 22, hWndMain, 0, 0, 0)
CreateWindowEx_(0, "Button", "Button 1", #WS_CHILD | #WS_VISIBLE, 10, 10, 100, 20, hWndMain, 0, 0, 0)
ShowWindow_(hWndMain, #SW_SHOWDEFAULT)
UpdateWindow_(hWndMain);
While GetMessage_(msg.MSG, #NULL, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend
; ExecutableFormat=Windows
; EOF
Code : Tout sélectionner
hWnd = CreateWindowEx_(0,"Static","ownwindow",#WS_CHILD | #WS_VISIBLE | $12,0,0,270,90,hWndMain,0,0,0)
Code : Tout sélectionner
Procedure WindowCallback(Window, message, wParam, lParam)
Select message
Case #WM_COMMAND
Select wParam&$FFFF
Case 10
MessageBox_(Window, "Info", "Le bouton à été clické",0)
EndSelect
Case #WM_CLOSE
If MessageBox_(Window, "Quitter?", "EXIT", #MB_YESNO) = #IDYES
DestroyWindow_(Window)
Else
result = 0
EndIf
Case #WM_DESTROY
PostQuitMessage_(0)
result = 0
Default
result = DefWindowProc_(Window, message, wParam, lParam)
EndSelect
ProcedureReturn result
EndProcedure
ProcedureDLL Creer_Fenetre()
#Style = #WS_VISIBLE | #WS_BORDER | #WS_SYSMENU
#StyleEx = 0
WindowClass.s = "MaFenetre"
wc.WNDCLASSEX
wc\cbSize = SizeOf(WNDCLASSEX)
wc\lpfnWndProc = @WindowCallback()
wc\hCursor = LoadCursor_(0, #IDC_ARROW)
wc\hbrBackground = #COLOR_WINDOW + 1;CreateSolidBrush_(RGB($8F,$8F,$8F))
wc\lpszClassName = @WindowClass
RegisterClassEx_(@wc)
hWndMain = CreateWindowEx_(#StyleEx, WindowClass, "Test-Window", #Style, 300, 300, 200, 200, 0, 0, 0, 0)
CreateWindowEx_(0, "Button", "Button 1", #WS_CHILD | #WS_VISIBLE, 10, 10, 100, 20, hWndMain, 10, 0, 0)
ShowWindow_(hWndMain, #SW_SHOWDEFAULT)
UpdateWindow_(hWndMain);
While GetMessage_(msg.MSG, #Null, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend
EndProcedure
Code : Tout sélectionner
#Librairie=0
If OpenWindow(0,200,200,400,400,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Pure Basic")
If CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 200, 20, "Créer une fenêtre")
EndIf
Repeat
EventID.l=WaitWindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case 0
If OpenLibrary(#Librairie, "dll_oliv.dll")
Debug "1"
CallFunction(#Librairie, "Creer_Fenetre")
CloseLibrary(#Librairie)
EndIf
EndSelect
Case #WM_CLOSE
Quit=1
EndSelect
Until Quit=1
EndIf
Code : Tout sélectionner
Procedure WindowCallback(Window, message, wParam, lParam)
Select message
Case #WM_COMMAND
Select wParam&$FFFF
Case 10
MessageBox_(Window, "Info", "Le bouton à été clické",0)
EndSelect
Case #WM_CLOSE
If MessageBox_(Window, "Quitter?", "EXIT", #MB_YESNO) = #IDYES
DestroyWindow_(Window)
Else
result = 0
EndIf
Case #WM_DESTROY
PostQuitMessage_(0)
result = 0
Default
result = DefWindowProc_(Window, message, wParam, lParam)
EndSelect
ProcedureReturn result
EndProcedure
ProcedureDLL Creer_Fenetre(hwndMain)
#Style = #WS_VISIBLE | #WS_BORDER | #WS_SYSMENU
#StyleEx = 0
WindowClass.s = "MaFenetre"
wc.WNDCLASSEX
wc\cbSize = SizeOf(WNDCLASSEX)
wc\lpfnWndProc = @WindowCallback()
wc\hCursor = LoadCursor_(0, #IDC_ARROW)
wc\hbrBackground = #COLOR_WINDOW + 1;CreateSolidBrush_(RGB($8F,$8F,$8F))
wc\lpszClassName = @WindowClass
RegisterClassEx_(@wc)
hWnd = CreateWindowEx_(0,"Static","ownwindow",#WS_CHILD | #WS_VISIBLE | $12,0,0,270,90,hWndMain,0,0,0)
CreateGadgetList(hWnd)
ButtonGadget(10,10,10,100,20,"Button 1")
ShowWindow_(hWndMain, #SW_SHOWDEFAULT)
UpdateWindow_(hWndMain);
While GetMessage_(msg.MSG, #Null, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend
EndProcedure
Code : Tout sélectionner
#Librairie=0
#Fenetre = 0
If OpenWindow(0,200,200,400,400,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Pure Basic")
If CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 200, 20, "Créer une fenêtre")
EndIf
Repeat
EventID.l=WaitWindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case 0
If OpenLibrary(#Librairie, "a.dll")
hWndMain = OpenWindow(#Fenetre,50,30,500,500,0,"Test")
CallFunction(#Librairie, "Creer_Fenetre",hWndMain)
CloseLibrary(#Librairie)
EndIf
EndSelect
Case #WM_CLOSE
Quit=1
EndSelect
Until Quit=1
EndIf
Code : Tout sélectionner
ProcedureDLL Creer_Fenetre()
OpenWindow(0,253,127,150,150,#PB_Window_Borderless,"Test")
CreateGadgetList(WindowID())
ButtonGadget(0,0,0,150,150,"Boutton DLL")
SetWindowPos_(WindowID(), -1, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
EndProcedure
ProcedureDLL Events()
Select WindowEvent()
Case #PB_EventGadget
Select EventGadgetID()
Case 0
MessageRequester("Click","Le boutton de la DLL vient d'être clické")
EndSelect
EndSelect
EndProcedure
ProcedureDLL Fermer_Fenetre()
CloseWindow(0)
EndProcedure
Code : Tout sélectionner
#Librairie=0
#Fenetre = 1
If OpenWindow(0,100,100,300,150,#PB_Window_SystemMenu,"Pure Basic")
If CreateGadgetList(WindowID(0))
ButtonGadget(0,0,0,150,150,"Boutton programme")
EndIf
SetWindowPos_(WindowID(), -2, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
If OpenLibrary(#Librairie, "a.dll")
CallFunction(#Librairie, "Creer_Fenetre")
*Events = IsFunction(#Librairie,"Events")
Repeat
EventID.l=WindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case 0
MessageRequester("Click","Le boutton du programme vient d'être clické")
EndSelect
Case #WM_CLOSE
Quit=1
EndSelect
CallFunctionFast(*Events)
Delay(10)
Until Quit=1
CallFunction(#Librairie,"Fermer_Fenetre")
CloseLibrary(#Librairie)
EndIf
EndIf
Code : Tout sélectionner
ProcedureDLL Creer_Fenetre()
OpenWindow(0,253,127,150,150,#PB_Window_Borderless,"Test")
CreateGadgetList(WindowID())
ButtonGadget(0,0,0,150,150,"Boutton DLL")
SetWindowPos_(WindowID(), -1, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
Select WindowEvent()
Case #PB_EventGadget
Select EventGadgetID()
Case 0
MessageRequester("Click","Le boutton de la DLL vient d'être clické")
EndSelect
EndSelect
EndProcedure
Code : Tout sélectionner
OpenWindow(0,253,127,150,150,#PB_Window_Borderless,"Test")
CreateGadgetList(WindowID())
ButtonGadget(0,0,0,150,150,"Boutton DLL")
SetWindowPos_(WindowID(), -1, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)