NELyon Posted August 29, 2006 Share Posted August 29, 2006 (edited) expandcollapse popup#include <GUIConstants.au3> HotKeySet("^q", "end") $gui = GUICreate("SimpleEditor",504,648,-1,-1,$WS_POPUP) GUICtrlCreatePic("skin.bmp",0,0,504,648, @SW_LOCK) $Edit1 = GUICtrlCreateEdit("", 30, 110, 440, 410) GUICtrlSetBkColor($Edit1, 0x555ff) $Button1 = GUICtrlCreateButton("Save", 34, 529, 100, 50) $Button2 = GUICtrlCreateButton("open", 191, 528, 100, 50) $Button3 = GUICtrlCreateButton("New", 340, 528, 100, 50) $a = DLLCall(".\BMP2RGN.dll","int","BMP2RGN", _ "str",".\larry.bmp", _ "int",0, _ "int",0, _ "int",0) SetWindowRgn($gui, $a[0]) GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $Button1 then FileWrite(FilesaveDialog("Select a file to save",@ScriptDir, "All Files (*.*)"),GUICtrlRead($Edit1)) ElseIf $Msg = $Button2 Then GUICtrlSetData($Edit1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)"))) ElseIf $Msg = $Button2 then GUICtrlSetData($Edit1, "") EndIf sleep(2000) WEnd Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc Func end() Exit EndFunc Does anyone know why the buttons won't work? I can click them, and they will get focus, and if i click the edit it will take focus, but the button's functions are ignored. I will attatch the picture in JPG form, but the image won't work unless converted back to bitmap. PS: Thanks larry for the great dll! Edited August 29, 2006 by codemyster Link to comment Share on other sites More sharing options...
Zedna Posted August 29, 2006 Share Posted August 29, 2006 If you want picture as background use GUICtrlCreatePic(...) GUICtrlSetState(-1, $GUI_DISABLE) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
NELyon Posted August 29, 2006 Author Share Posted August 29, 2006 I have it set up, all of the controls appear, and i can click on them all to give them ficus. When i click my buttons, they press down, but the function just isn't called. None of the buttons get called. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted August 29, 2006 Share Posted August 29, 2006 yes the picture is taking the focus away and everything you must disable it or else your controls will not work Link to comment Share on other sites More sharing options...
NELyon Posted August 29, 2006 Author Share Posted August 29, 2006 (edited) I $GUI_DISABLE'd it and it did the same thing. I can click the buttons, and change the focus between the controls 100% Fine, it is just the funtions are not being called when i click the buttons. Edited August 29, 2006 by codemyster Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted August 29, 2006 Share Posted August 29, 2006 (edited) HGAAHHA scratch that error, forgot to put the dll on my desktop i dont see what your trying to do ive seen larrys thing b4 but your creating a picture as a background but then setting larrys picture as the background , and the shape of the gui why? Edited August 29, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
NELyon Posted August 29, 2006 Author Share Posted August 29, 2006 So there is no title bar at all, so it looks like the top of the image is a forged title bar Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted August 29, 2006 Share Posted August 29, 2006 to my stupidty i didnt notice you had the sleep(2000) in the loop #include <GUIConstants.au3> HotKeySet("^q", "end") $gui = GUICreate("SimpleEditor",504,648,-1,-1,$WS_POPUP) GUICtrlCreatePic("skin.bmp",0,0,504,648, @SW_LOCK) $Edit1 = GUICtrlCreateEdit("", 30, 110, 440, 410) GUICtrlSetBkColor($Edit1, 0x555ff) $Button1 = GUICtrlCreateButton("Save", 34, 529, 100, 50) $Button2 = GUICtrlCreateButton("open", 191, 528, 100, 50) $Button3 = GUICtrlCreateButton("New", 340, 528, 100, 50) $a = DLLCall(".\BMP2RGN.dll","int","BMP2RGN", _ "str",".\skin.bmp", _ "int",0, _ "int",0, _ "int",0) SetWindowRgn($gui, $a[0]) GUISetState() While 1 $Msg = GUIGetMsg($gui) If $Msg = $Button1 then FileWrite(FilesaveDialog("Select a file to save",@ScriptDir, "All Files (*.*)"),GUICtrlRead($Edit1)) ElseIf $Msg = $Button2 Then GUICtrlSetData($Edit1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)"))) ElseIf $Msg = $Button2 then GUICtrlSetData($Edit1, "") EndIf WEnd Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc Func end() Exit EndFunc Link to comment Share on other sites More sharing options...
NELyon Posted August 29, 2006 Author Share Posted August 29, 2006 Yes! Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now