Klexen Posted November 6, 2007 Share Posted November 6, 2007 Is this at all possible with autoit? Link to comment Share on other sites More sharing options...
Monamo Posted November 6, 2007 Share Posted November 6, 2007 Is this at all possible with autoit?Fantastic method here for custom GUI shapes based upon a .PNG - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
BigDod Posted November 6, 2007 Share Posted November 6, 2007 Here is an example based on Larry's script #include <GUIConstants.au3> HotKeySet("{ESC}", "Terminate") Func Terminate() GUIDelete($gui) Exit EndFunc ;==>Terminate Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>SetWindowRgn $gui = GUICreate("", 600, 383, -1, -1, $WS_POPUP) GUICtrlCreatePic(".\superman.bmp", 0, 0, 600, 383) $a = DllCall(".\BMP2RGN.dll", "int", "BMP2RGN", _ "str", ".\superman.bmp", _ "int", 255, _ "int", 255, _ "int", 255) SetWindowRgn($gui, $a[0]) GUISetState(@SW_SHOW, $gui) While 1 Sleep(50) WEnd attached files required. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Zedna Posted November 6, 2007 Share Posted November 6, 2007 Core API function is SetWindowRgn, so search example forum for this to see more examples. Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Klexen Posted November 6, 2007 Author Share Posted November 6, 2007 Thanks guys, I will definately check this out. I was also wondering if it would be possible to remove the gray background on my radio buttons? I have them ontop of an image, and it looks dumb because you have an image with a long gray rectangle. Link to comment Share on other sites More sharing options...
Valuater Posted November 6, 2007 Share Posted November 6, 2007 using Big Dods info... ... This will do the trick!!! expandcollapse popup#include <GUIConstants.au3> Global Const $WM_LBUTTONDOWN = 0x0201 Global Const $WM_SYSCOMMAND = 0x0112 Dim $XS_n Dim $Pic_File = "c:\temp\superman.bmp" HotKeySet("{ESC}", "Terminate") $gui = GUICreate("", 600, 383, -1, -1, $WS_POPUP) XPStyle (1) $pic = GUICtrlCreatePic($Pic_File, 0, 0, 600, 383, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetState($pic, $GUI_DISABLE) $chk_bx = GUICtrlCreateCheckbox("this is a checkbox", 220, 10, 120, 20) GUICtrlSetColor($chk_bx, 0xFF0000) GUICtrlSetBkColor($chk_bx, "") XPStyle (0) GUISetState() SetWindowRgn($gui, $Pic_File) GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") While 1 Sleep(50) WEnd Func _WinMove($HWnd, $Command, $wParam, $lParam) If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0) EndFunc ;==>_WinMove Func XPStyle ($OnOff = 1) If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyle Func Terminate() GUIDelete($gui) Exit EndFunc ;==>Terminate Func SetWindowRgn($h_win, $p_rgn) $a = DllCall(".\BMP2RGN.dll", "int", "BMP2RGN", "str", $p_rgn, "int", 255, "int", 255, "int", 255) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $a[0], "int", 1) EndFunc ;==>SetWindowRgn 8) Link to comment Share on other sites More sharing options...
Klexen Posted November 6, 2007 Author Share Posted November 6, 2007 using Big Dods info... ... This will do the trick!!! expandcollapse popup#include <GUIConstants.au3> Global Const $WM_LBUTTONDOWN = 0x0201 Global Const $WM_SYSCOMMAND = 0x0112 Dim $XS_n Dim $Pic_File = "c:\temp\superman.bmp" HotKeySet("{ESC}", "Terminate") $gui = GUICreate("", 600, 383, -1, -1, $WS_POPUP) XPStyle (1) $pic = GUICtrlCreatePic($Pic_File, 0, 0, 600, 383, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetState($pic, $GUI_DISABLE) $chk_bx = GUICtrlCreateCheckbox("this is a checkbox", 220, 10, 120, 20) GUICtrlSetColor($chk_bx, 0xFF0000) GUICtrlSetBkColor($chk_bx, "") XPStyle (0) GUISetState() SetWindowRgn($gui, $Pic_File) GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") While 1 Sleep(50) WEnd Func _WinMove($HWnd, $Command, $wParam, $lParam) If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0) EndFunc ;==>_WinMove Func XPStyle ($OnOff = 1) If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyle Func Terminate() GUIDelete($gui) Exit EndFunc ;==>Terminate Func SetWindowRgn($h_win, $p_rgn) $a = DllCall(".\BMP2RGN.dll", "int", "BMP2RGN", "str", $p_rgn, "int", 255, "int", 255, "int", 255) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $a[0], "int", 1) EndFunc ;==>SetWindowRgn 8) I get this error when trying to run script... ERROR: $WM_SYSCOMMAND previously declared as a 'Const' Global Const $WM_SYSCOMMAND = 0x0112 Link to comment Share on other sites More sharing options...
Valuater Posted November 6, 2007 Share Posted November 6, 2007 Thats because you are using beta, just comment out that line with a ";" Like this ;Global Const $WM_SYSCOMMAND = 0x0112 8) Link to comment Share on other sites More sharing options...
Klexen Posted November 6, 2007 Author Share Posted November 6, 2007 Wow man you're awesome. Thanks.... So I can change the color, but can I make it transparent? What do I lose from commenting this out? Global Const $WM_SYSCOMMAND = 0x0112 ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 6, 2007 Share Posted November 6, 2007 What do I lose from commenting this out? Global Const $WM_SYSCOMMAND = 0x0112 ?Nothing. The constant has already been declared in one of your #include files. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valuater Posted November 6, 2007 Share Posted November 6, 2007 What do I lose from commenting this out? Global Const $WM_SYSCOMMAND = 0x0112 ?Nothing, there is no problem, it just wont work with the public release of Autoit without that line*********another way to "skin the cat" with checkbox and transparency isexpandcollapse popup#include <GUIConstants.au3> Global Const $WM_LBUTTONDOWN = 0x0201 ;Global Const $WM_SYSCOMMAND = 0x0112 Dim $XS_n Dim $Pic_File = "c:\temp\superman.bmp" HotKeySet("{ESC}", "Terminate") $gui = GUICreate("", 600, 383, -1, -1, $WS_POPUP) XPStyle (1) $pic = GUICtrlCreatePic($Pic_File, 0, 0, 600, 383, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetState($pic, $GUI_DISABLE) $chk_bx = GUICtrlCreateCheckbox("", 205, 10, 13, 13) $lbl = GUICtrlCreateLabel("This is a checkbox", 220, 10, 120, 15) GUICtrlSetColor($lbl, 0xFF0000) GUICtrlSetBkColor($lbl, $GUI_BKCOLOR_TRANSPARENT ) XPStyle (0) GUISetState() SetWindowRgn($gui, $Pic_File) GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") While 1 Sleep(50) WEnd Func _WinMove($HWnd, $Command, $wParam, $lParam) If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0) EndFunc ;==>_WinMove Func XPStyle ($OnOff = 1) If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyle Func Terminate() GUIDelete($gui) Exit EndFunc ;==>Terminate Func SetWindowRgn($h_win, $p_rgn) $a = DllCall(".\BMP2RGN.dll", "int", "BMP2RGN", "str", $p_rgn, "int", 255, "int", 255, "int", 255) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $a[0], "int", 1) EndFunc ;==>SetWindowRgn*****************Welcome!!!8) Link to comment Share on other sites More sharing options...
Klexen Posted November 6, 2007 Author Share Posted November 6, 2007 Wow this is great, it looks really good. Only thing is I need to use a radio button. Well not exactly NEED to, but would like to. Since the Checkbox is square, you get no color behind it. But if u use a radio with a -w13 -h13 you still see a little grey behind it. Anything I can do about that? Link to comment Share on other sites More sharing options...
DirtDBaK Posted November 6, 2007 Share Posted November 6, 2007 when i run your first example (valuater) i get an error: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Owner\Desktop\temp.au3" C:\Documents and Settings\Owner\Desktop\temp.au3 (54) : ==> Subscript used with non-Array variable.: DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $a[0], "int", 1) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $a^ ERROR >Exit code: 1 Time: 0.313 [center][/center] Link to comment Share on other sites More sharing options...
DirtDBaK Posted November 6, 2007 Share Posted November 6, 2007 nevermind i got it working just didnt need the array value just $a [center][/center] 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