farhadrahman2 Posted March 18, 2016 Share Posted March 18, 2016 Hi guys I need help with a script I have already compiled .But when I open it ,it works fine and as soon as I minimize it and maximize it after a while I see all my buttons and labels disappeared. I'm going to attach some files . Please help me fix it. Link to comment Share on other sites More sharing options...
InunoTaishou Posted March 18, 2016 Share Posted March 18, 2016 Try _WinApi_RedrawWindow(Handle to your window) Did you set your background pic control to $GUI_DISABLE? GUICtrlSetState(Id of pic, $GUI_DISABLE) You can also try _WinApi_RedrawWindow(GUICtrlGetHandle(Id of button)) for each button Link to comment Share on other sites More sharing options...
farhadrahman2 Posted March 19, 2016 Author Share Posted March 19, 2016 (edited) Yeah I did set the background pic control to $Gui_disable and I tried both the methods but it's still not working. Here is my script expandcollapse popup#include <ColorConstants.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <WinAPI.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $hGUI = GUICreate("Launch It - By PC HACKZ", 640, 400) Local $idOK = GUICtrlCreateButton("Launch Notepad ", 5, 260, 90, 30, $BS_FLAT) _WinAPI_RedrawWindow(GUICtrlGetHandle($idOK)) GUICtrlSetTip($idOK, "Click Here To Launch Notepad") Local $fucj = GUICtrlCreateButton("Launch CMD ", 5, 295, 90, 30) GUICtrlSetTip($fucj, "Click Here To Launch Command Prompt") Local $fuck = GUICtrlCreateButton("Launch Paint ", 5, 330, 90, 30) GUICtrlSetTip($fuck, "Click Here To Launch Paint") Local $fucl = GUICtrlCreateButton("Launch Narrator ", 5, 365, 90, 30) GUICtrlSetTip($fucl, "Click Here To Launch Narrator") Local $fucg = GUICtrlCreateButton("Launch Wordpad ", 545, 260, 90, 30) GUICtrlSetTip($fucg, "Click Here To Launch Wordpad") Local $fucs = GUICtrlCreateButton("Launch System Info. ", 530, 295, 105, 30) GUICtrlSetTip($fucs, "Click Here To See Your System's Information") Local $fuch = GUICtrlCreateButton("Launch Registry Editor ", 520, 330, 115, 30) GUICtrlSetTip($fuch, "Click Here To Make Changes To Your Registry ") Local $fuci = GUICtrlCreateButton("Launch Resource Monitor ", 505, 365, 130, 30) GUICtrlSetTip($fuci, "Click Here To Monitor Your Resources") Local $about = GUICtrlCreateButton("About", 545, 5, 90, 30) GUICtrlSetTip($about, "Click Here To Get Some Intel About US") Local $label = GUICtrlCreateLabel("Click Here To Visit Pc Hackz ", 190, 355, 270, 20) GUICtrlSetCursor($label, 0) GUICtrlSetFont($label, 15, 700) GUICtrlSetBkColor($label, $GUI_BKCOLOR_TRANSPARENT) Local $label1 = GUICtrlCreateLabel("Welcome To Launch It ", 205, 180, 230, 25) GUICtrlSetFont($label1, 17, 700) GUICtrlSetBkColor($label1, $GUI_BKCOLOR_TRANSPARENT) _WinAPI_SetLayeredWindowAttributes($hGUI, 0x010101) GUISetState(@SW_SHOW) Local $idpic = GUICtrlCreatePic("E:\DEFAULT_GUI_PIC.jpg", 1, 1, 640, 400) GUISetState($idpic, $GUI_DISABLE) While 1 Switch GUIGetMsg() Case $idOK ShellExecute("notepad.exe") Case $fucj ShellExecute("cmd.exe") Case $fuck ShellExecute("mspaint.exe") Case $fucl ShellExecute("Narrator.exe") Case $fucg ShellExecute("C:\Program Files\Windows NT\Accessories\wordpad.exe") Case $fucs ShellExecute("msinfo32.exe") Case $fuch ShellExecute("regedt32.exe") Case $fuci ShellExecute("resmon.exe") Case $about MsgBox(8256, "PC HACKZ - About", "LAUNCHY" & @CRLF & "" & @CRLF & "Version - 1.0" & @CRLF & "" & @CRLF & _ "Made By PC HACKZ" & @CRLF & "" & @CRLF & "Like US & Share our posts." & @CRLF & "" & @CRLF & _ "Visit www.pchackz.wordpress.com ." & @CRLF & "") Case $label ShellExecute("www.pchackz.wordpress.com") Case -3 Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(8244, "PC HACKZ ", "Are You Sure You Want To Close Our App? ") Select Case $iMsgBoxAnswer = 6 ;Yes Exit Case $iMsgBoxAnswer = 7 ;No EndSelect EndSwitch WEnd EndFunc ;==>Example Edited March 19, 2016 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 19, 2016 Moderators Share Posted March 19, 2016 farhadrahman2, Welcome to the AutoIt forums. When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
farhadrahman2 Posted March 19, 2016 Author Share Posted March 19, 2016 Thanks for correcting me . I was wondering if anybody could give me the solution to my problem. Thanks in advance. Link to comment Share on other sites More sharing options...
AutoBert Posted March 19, 2016 Share Posted March 19, 2016 Just create Pic first and set it's state (not the Gui) to disable: expandcollapse popup#include <ColorConstants.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <WinAPI.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $hGUI = GUICreate("Launch It - By PC HACKZ", 640, 400) Local $idpic = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\GUI\msoobe.jpg", 1, 1, 640, 400) GUICtrlSetState($idpic, $GUI_DISABLE) ;<============ GuiCtrlSetState Local $idOK = GUICtrlCreateButton("Launch Notepad ", 5, 260, 90, 30, $BS_FLAT) GUICtrlSetTip($idOK, "Click Here To Launch Notepad") Local $fucj = GUICtrlCreateButton("Launch CMD ", 5, 295, 90, 30) GUICtrlSetTip($fucj, "Click Here To Launch Command Prompt") Local $fuck = GUICtrlCreateButton("Launch Paint ", 5, 330, 90, 30) GUICtrlSetTip($fuck, "Click Here To Launch Paint") Local $fucl = GUICtrlCreateButton("Launch Narrator ", 5, 365, 90, 30) GUICtrlSetTip($fucl, "Click Here To Launch Narrator") Local $fucg = GUICtrlCreateButton("Launch Wordpad ", 545, 260, 90, 30) GUICtrlSetTip($fucg, "Click Here To Launch Wordpad") Local $fucs = GUICtrlCreateButton("Launch System Info. ", 530, 295, 105, 30) GUICtrlSetTip($fucs, "Click Here To See Your System's Information") Local $fuch = GUICtrlCreateButton("Launch Registry Editor ", 520, 330, 115, 30) GUICtrlSetTip($fuch, "Click Here To Make Changes To Your Registry ") Local $fuci = GUICtrlCreateButton("Launch Resource Monitor ", 505, 365, 130, 30) GUICtrlSetTip($fuci, "Click Here To Monitor Your Resources") Local $about = GUICtrlCreateButton("About", 545, 5, 90, 30) GUICtrlSetTip($about, "Click Here To Get Some Intel About US") Local $label = GUICtrlCreateLabel("Click Here To Visit Pc Hackz ", 190, 355, 270, 20) GUICtrlSetCursor($label, 0) GUICtrlSetFont($label, 15, 700) GUICtrlSetBkColor($label, $GUI_BKCOLOR_TRANSPARENT) Local $label1 = GUICtrlCreateLabel("Welcome To Launch It ", 205, 180, 230, 25) GUICtrlSetFont($label1, 17, 700) GUICtrlSetBkColor($label1, $GUI_BKCOLOR_TRANSPARENT) ;_WinAPI_SetLayeredWindowAttributes($hGUI, 0x010101) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $idOK ShellExecute("notepad.exe") Case $fucj ShellExecute("cmd.exe") Case $fuck ShellExecute("mspaint.exe") Case $fucl ShellExecute("Narrator.exe") Case $fucg ShellExecute("C:\Program Files\Windows NT\Accessories\wordpad.exe") Case $fucs ShellExecute("msinfo32.exe") Case $fuch ShellExecute("regedt32.exe") Case $fuci ShellExecute("resmon.exe") Case $about MsgBox(8256, "PC HACKZ - About", "LAUNCHY" & @CRLF & "" & @CRLF & "Version - 1.0" & @CRLF & "" & @CRLF & "Made By PC HACKZ" & @CRLF & "" & @CRLF & "Like US & Share our posts." & @CRLF & "" & @CRLF & "Visit www.pchackz.wordpress.com ." & @CRLF & "") Case $label ShellExecute("www.pchackz.wordpress.com") Case -3 Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(8244, "PC HACKZ ", "Are You Sure You Want To Close Our App? ") Select Case $iMsgBoxAnswer = 6 ;Yes Exit Case $iMsgBoxAnswer = 7 ;No EndSelect EndSwitch WEnd EndFunc ;==>Example and as Melba23 said: use Code tags as i did. Link to comment Share on other sites More sharing options...
farhadrahman2 Posted March 19, 2016 Author Share Posted March 19, 2016 Awesome job man!!! Now it's working perfect . Can you do me a favor and tell me how to make the picture on my GUI transparent. Thanks for the time and help. Link to comment Share on other sites More sharing options...
AutoBert Posted March 19, 2016 Share Posted March 19, 2016 Afaik not possible with JPG's, only with PNG's. Link to comment Share on other sites More sharing options...
farhadrahman2 Posted March 19, 2016 Author Share Posted March 19, 2016 Okay then I will convert the image to PNG and then will it work. Link to comment Share on other sites More sharing options...
AutoBert Posted March 19, 2016 Share Posted March 19, 2016 A example from @UEZ: expandcollapse popup#include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global Const $SC_DRAGMOVE = 0xF012 Global $iW, $iH, $hImage, $hBitmap, $hGUI $hImage = _GDIPlus_BitmapCreateFromFile("C:\Program Files\AutoIt3\Examples\GUI\Torus.png") $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetState() _WinAPI_BitmapDisplayTransparentInGUI($hBitmap, $hGUI) GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() GUIDelete() Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $bReleaseGDI = True) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local $tDim = DllStructCreate($tagBITMAP) If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) $tSize.X = $tDim.bmWidth $tSize.Y = $tDim.bmHeight $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap) Return True EndFunc Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc ;==>_WM_LBUTTONDOWN Link to comment Share on other sites More sharing options...
farhadrahman2 Posted March 19, 2016 Author Share Posted March 19, 2016 Thanks . It helped me a lot. See you around. Link to comment Share on other sites More sharing options...
farhadrahman2 Posted May 8, 2016 Author Share Posted May 8, 2016 hey guys i found something Try this to set the pic and the gui to transparent. WinSetTrans(#hgui,"",230) Have a good day 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