Leaderboard
Popular Content
Showing content with the highest reputation on 02/18/2015 in all areas
-
2 points
-
LAST VERSION - 1.0 25-Jan-15 This is my way to use the API ReadDirectoryChangesW in AutoIt. The problem is that to use this function will not work fully without creating thread. To solve this problem, I wrote the simple DLL that provides work with threads. As a result, the AutoIt script only receives and processes the appropriate data from thread. To evaluate all features of the library, please see the full example with GUI for monitoring directories. For more information, see description for each function within the library. The following are the main features of the RDC UDF library. Creating multiple threads (unlimited) for monitoring different directories.Support for hot (unsafe) unplugging of removable devices such as USB flash drive, etc.Support for network drives.Support for 32- and 64-bit processes (RDC.dll and RDC_x64.dll).Easy to use functions from the library.Full examples, including GUI. Available functions RDC UDF Library v1.0 (x86 and x64) Previous downloads: 17 RDC.zip Examples Simple (Notification mode) Advanced GUI1 point
-
LAST VERSION - 1.1 04-Nov-10 The library contains only one _NotifyBox() function, which is similar to the MsgBox(), with the only difference being that runs in a separate thread and therefore has no stopping the script. Parameters are identical to the MsgBox() function. If you plan to periodically call _NotifyBox(), I recommend to specify the time (in seconds) after which a notification window will be automatically closed (see $iTimeOut parameter). Otherwise, very soon, your desktop will be littered with these windows. NotifyBox UDF Library v1.1 Previous downloads: 149 NotifyBox.au3 Example #Include "NotifyBox.au3" Opt('TrayAutoPause', 0) While 1 _NotifyBox(16, ':-(', 'One.', 2) Sleep(500) _NotifyBox(48, ':-|', 'Two.', 2) Sleep(500) _NotifyBox(64, ':-)', 'Three.', 2) Sleep(3000) WEnd1 point
-
A Note to Voters The entries for this challenge appear in the following two posts below this one. The purpose here is to demonstrate AutoIt to a beginner. The code should be easy to follow if you are a beginner. Speculation about the authors is expected, but remember it is the code you are voting for, not the person who wrote it. Before casting a vote please read the 7 criteria listed below. You are entitled to cast one vote for one piece of code which you think would make a good example for the wikipedia article. A Note to Participants Although it may be tempting, I would like it if you refrain from dropping hints to the voters once voting begins. Deadline for Voting Voting will last approximately 3 days until midnight GMT on 23rd of February. In the Event of a Tie If there is no clear winner after the period for voting has ended, finalists will be selected and voting will go to sudden death, whereby whichever of the the remaining contestants has the most votes at a time determined without forewarning by the arbiter, will be declared the winner. If it is still neck and neck after this period has elapsed, the winner will be selected using a formula. ; $iWinner = Mod(StringLen("JohnOne" & "Xandy"), 2) ; Now we've seen what the community can do, it's time for us MVPs to be judged by the community. What has been suggested is that a second example ought to be written to demonstrate a simple automation task to an absolute beginner. So let's show the community what we can do! You are allowed no more than 32 lines of code including comments. As before, the new example should: 1. comply to standard coding practices 2. be easy to follow 3. do something useful 4. be of interest to a wide audience 5. comply with the rules of the forum 6. not be longer than exactly 32 lines of code 7. convey the ease of use of AutoIt to beginners Names will be removed from submissions by an independant arbiter before being judged. The community will vote for the code they like best. Only current MVPs are allowed to enter, and no MVP is entitled to vote for the winner. Team efforts can also be submitted. The deadline for submissions will be 20th February 2015. The arbiter is jaberwacky once more. All submissions should be sent to the arbiter. The community will be given three days to vote for the winner, once jaberwacky has posted the examples we send to him. After voting has finished jaberwacky will reveal the name of the MVP whose code you like best. Good luck to everyone! The winning examples from both challenges will be added to the Wikipedia page.1 point
-
Script only does 1 line then wait then terminate
AchterlijkeVleugel reacted to jdelaney for a topic
you can't press the s, when it's already 'down'. Either just send "s", or send it back 'up'.1 point -
TheSaint, I'm really sorry, I didn't pay attention enough to the comment in the downloaded txt file I apologize BTW I had a look to the new version, looks promising but the .au3 is intended to run with the beta and I'm currently using the 3.3.12.0 release...1 point
-
AND operator and work with if statement
MikahS reacted to JLogan3o13 for a topic
As MikahS pointed out, it is a bit irritating having to first guess at what you're doing, and then troubleshoot the problem. Workable, running code is always best. Try something like this and see if it works for you: If $pwdinput is blank, fails. If $pwdinput does not equal $pwlabeled, fails. If $pwdinput is not blank, and equals $pwlabeled, then if $namelist equals $bArray[1], succeeds. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Test", 300, 300) $pwdinput = GUICtrlCreateInput("", 10, 10, 280, 40) $namelist = GUICtrlCreateInput("", 10, 60, 280, 40) $button = GUICtrlCreateButton("Go", 10, 120, 40, 40) $pwlabeled = 1 Local $bArray[2] = ["Sue","Henry"] GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $button If GUICtrlRead($pwdinput) <> "" And GUICtrlRead($pwdinput) <> $pwlabeled Then If GUICtrlRead($namelist) = $bArray[1] Then MsgBox(0, "", "Worked") Else MsgBox(0, "", "Failed") EndIf EndSwitch WEnd GUIDelete()1 point -
Jekov, Why did you hijack a 7 year old thread which had nothing to do with the question you are asking? In future, just open a new thread as I have now done for you. M231 point
-
Oops, didn't even see that error. Note to OP, you should post a script that's reproducible (what you provided is not) if you want all corrections fixed on the first go around. Like this: #include <Array.au3> Local $confirmed_po_links[1][2]=[["testa","test1"]] _ArrayDisplay($confirmed_po_links,"before") ReDim $confirmed_po_links[UBound($confirmed_po_links)+1][2] $confirmed_po_links[UBound($confirmed_po_links)-1][0] = "testb" $confirmed_po_links[UBound($confirmed_po_links)-1][1] = "test2" _ArrayDisplay($confirmed_po_links,"after")1 point
-
LOL. So if an example appears that has a message saying 'mirror mirror on the wall', we'll know it's been written by you.1 point
-
Patching EXEs is a common practice since the earliest ages of PCs, when networks were not as fast as now and disk space was not as large as today. The logic at the base of patching an EXE is that you have to have a program that gets the differences between the old EXE and the new EXE and builds a third EXE that will go to patch the old EXE. Two good softwares that do this job are xdelta and bsdiff.1 point
-
File download with inetget fails
argumentum reacted to mikell for a topic
Probably a confusion concerning the address because this works InetGet("http://www.abrakadabra.pm/files/61730479_107431142/", @DesktopDir & "\James1.mp3") while the code in post #1 returns the html source of the home page1 point -
Wordpress help
JohnOne reacted to jvanegmond for a topic
You're dealing with a misconfiguration of Apache and PHP. Normally your hosting provider does this proper for you, or provides instructions how you can do this yourself. I'd check the latter and if no instructions are provided, I'd email them and if the response is less than satisfactory, I honestly recommend changing hosting partner right away. It's a pain in the ass to work with poor hosting providers and any indication they are bad should be cause to immediately migrate. Apache has to be told that .php files must be ran through PHP and the output of that interpreter will be the actual page. The way it works inside of Apache is it registers certain programs like PHP to handle specific file types. The way you have posted with using AddType sets the MIME type for .php files to one that Apache understands as needing PHP . PHP then changes the actual MIME type sent to the client to the appropriate type (text/html usually). So what's wrong with the way you've done it now? Any .php in the file name will execute the file as a PHP file. If a malicious user uploads a file called image.php.png it will be executed as PHP. That's a security risk. It's also a pain to do this in the .htaccess file, it should be in the php.conf file (in httpd/conf.d/php.conf or something) so it is globally enabled in a safe way like this: <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>1 point -
/AutoIt3ExecuteScript no longer working with compiled scripts?
Darkbanner reacted to JohnOne for a topic
There is some #pragma directive you have to set to true, which is false by default, not sure which. EDIT: #pragma compile(AutoItExecuteAllowed, true)1 point -
Your logic is off on your condition statements too. Does $aPrinterList[$x][18] return a string? That's what you're comparing it too, more likely it returns a boolean. You're checking @error on something that cannot return an "@error". Global $aPrinterList = _EnumPrinterProperties("\\*") If Not IsArray($aPrinterList) Then Exit 2 EndIf ; validate ubound 2nd dim If (UBound($aPrinterList, 2) - 1) < 18 Then Exit 3 EndIf Global $queue, $oldPrinter, $newPrinter For $x = 0 To UBound($aPrinterList, 1) - 1 $queue = $aPrinterList[$x][6] If $queue = $oldPrinter Then _RemovePrinter($oldPrinter) _AddWindowsPrinterConnection($newPrinter) If $aPrinterList[$x][18] Then _SetDefaultPrinter($newPrinter) EndIf EndIf Next .1 point
-
Wiki Challenge Part 2
czardas reacted to jaberwacky for a topic
I did? I don't really have much of any say in this. Just a simple minded arbiter tis all. My stance is pretty much: czardas' challenge, czardas' rules.1 point -
Yes, I hadn't thought of trying that. It shows exactly what I'm saying and it gives the solution. If instead of GuiSetState(@SW_HIDE) I can use WinSetState("Child","",@SW_HIDE) and that works $ch = GUICreate("Child",300,300,10,10) $testBtn = GUICtrlCreateButton("Test",100,100) GUISetState() sleep(500) winsetstate("Child","",@SW_HIDE) while 1 $Msg = GUIGetMsg() if $msg = -3 then Exit if $msg = $testBtn then msgbox(262144,"result","button pressed") WEnd Thanks czardas1 point
-
Here's the de-facto best implementation(s) of Windows Explorer for AU3: '?do=embed' frameborder='0' data-embedContent>> The code is a bit.. peculiar.. but works fine once you get your head around the folder structure the author has used for this project. Good luck.1 point
-
LAST VERSION - 1.3 28-Jan-15 Unlike >this, here is a fully ready UDF library. The library allows you to create TreeView (TV) Explorer controls that displays a tree of files and folders for the specified root folder with the specified parameters. TV Explorer controls is self-contained GUI controls that do not require you any further doing. Note that TVExplorer UDF requires >WinAPIEx UDF version 3.3 or later. To create TV Explorer control, just call the _GUICtrlTVExplorer_Create() function. And that's it. If you want to be notified about events such as the changing selection, the beginning and ending of the updating TV Explorer control, mounting and unmounting removeable drives, etc., you must specify a user function to retrieve these notifications, like WM-functions. How it works is shown in the following example. This library can work in "Loop" and "OnEvent" GUI modes. If the "GUIOnEventMode" option is set to 0, you should use _GUICtrlTVExplorer_GetMsg() instead of native GUIGetMsg() function, otherwise, the TV Explorer controls will not work. In using, these two functions are completely equivalent. A more detailed description of all functions you'll find inside the library. Available functions TVExplorer UDF Library v1.2 Previous downloads: 2266 TVExplorer.zip Example 1 #Include <APIConstants.au3> #Include <GUIConstantsEx.au3> #Include <GUITreeView.au3> #Include <TVExplorer.au3> #Include <TreeViewConstants.au3> #Include <WindowsConstants.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global $hForm, $hTV[3], $Input[3], $hFocus = 0, $Dummy, $Path, $Style If Not _WinAPI_DwmIsCompositionEnabled() Then $Style = $WS_EX_COMPOSITED Else $Style = -1 EndIf $hForm = GUICreate('TVExplorer UDF Example', 700, 736, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX), $Style) GUISetIcon(@WindowsDir & '\explorer.exe') $Input[0] = GUICtrlCreateInput('', 20, 20, 320, 19) GUICtrlSetState(-1, $GUI_DISABLE) $hTV[0] = _GUICtrlTVExplorer_Create(@ProgramFilesDir, 20, 48, 320, 310, -1, $WS_EX_CLIENTEDGE, -1, '_TVEvent') $Input[1] = GUICtrlCreateInput('', 360, 20, 320, 19) GUICtrlSetState(-1, $GUI_DISABLE) $hTV[1] = _GUICtrlTVExplorer_Create(@UserProfileDir, 360, 48, 320, 310, -1, $WS_EX_CLIENTEDGE, -1, '_TVEvent') $Input[2] = GUICtrlCreateInput('', 20, 378, 660, 19) GUICtrlSetState(-1, $GUI_DISABLE) $hTV[2] = _GUICtrlTVExplorer_Create('', 20, 406, 660, 310, -1, $WS_EX_CLIENTEDGE, -1, '_TVEvent') For $i = 0 To 2 _TVSetPath($Input[$i], _GUICtrlTVExplorer_GetSelected($hTV[$i])) _GUICtrlTVExplorer_SetExplorerStyle($hTV[$i]) Next $Dummy = GUICtrlCreateDummy() GUIRegisterMsg($WM_GETMINMAXINFO, 'WM_GETMINMAXINFO') GUIRegisterMsg($WM_SIZE, 'WM_SIZE') HotKeySet('{F5}', '_TVRefresh') GUISetState() _GUICtrlTVExplorer_Expand($hTV[0], @ProgramFilesDir & '\AutoIt3') _GUICtrlTVExplorer_Expand($hTV[1]) While 1 Switch _GUICtrlTVExplorer_GetMsg() Case $GUI_EVENT_CLOSE GUIDelete() _GUICtrlTVExplorer_DestroyAll() Exit Case $Dummy $Path = _GUICtrlTVExplorer_GetSelected($hFocus) _GUICtrlTVExplorer_AttachFolder($hFocus) _GUICtrlTVExplorer_Expand($hFocus, $Path, 0) $hFocus = 0 EndSwitch WEnd Func _TVEvent($hWnd, $iMsg, $sPath, $hItem) Switch $iMsg Case $TV_NOTIFY_BEGINUPDATE GUISetCursor(1, 1) Case $TV_NOTIFY_ENDUPDATE GUISetCursor(2) Case $TV_NOTIFY_SELCHANGED For $i = 0 To 2 If $hTV[$i] = $hWnd Then _TVSetPath($Input[$i], $sPath) ExitLoop EndIf Next Case $TV_NOTIFY_DBLCLK ; Nothing Case $TV_NOTIFY_RCLICK ; Nothing Case $TV_NOTIFY_DELETINGITEM ; Nothing Case $TV_NOTIFY_DISKMOUNTED ; Nothing Case $TV_NOTIFY_DISKUNMOUNTED ; Nothing EndSwitch EndFunc ;==>_TVEvent Func _TVSetPath($iInput, $sPath) Local $Text = _WinAPI_PathCompactPath(GUICtrlGetHandle($iInput), $sPath, -2) If GUICtrlRead($iInput) <> $Text Then GUICtrlSetData($iInput, $Text) EndIf EndFunc ;==>_TVSetPath Func _TVRefresh() Local $hWnd = _WinAPI_GetFocus() For $i = 0 To 2 If $hTV[$i] = $hWnd Then If Not $hFocus Then $hFocus = $hWnd GUICtrlSendToDummy($Dummy) EndIf Return EndIf Next HotKeySet('{F5}') Send('{F5}') HotKeySet('{F5}', '_TVRefresh') EndFunc ;==>_TVRefresh Func WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) Local $tMMI = DllStructCreate('long Reserved[2];long MaxSize[2];long MaxPosition[2];long MinTrackSize[2];long MaxTrackSize[2]', $lParam) Switch $hWnd Case $hForm DllStructSetData($tMMI, 'MinTrackSize', 428, 1) DllStructSetData($tMMI, 'MinTrackSize', 450, 2) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_GETMINMAXINFO Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) Local $WC, $HC, $WT, $HT Switch $hWnd Case $hForm $WC = _WinAPI_LoWord($lParam) $HC = _WinAPI_HiWord($lParam) $WT = Floor(($WC - 60) / 2) $HT = Floor(($HC - 116) / 2) GUICtrlSetPos(_WinAPI_GetDlgCtrlID($hTV[0]), 20, 48, $WT, $HT) GUICtrlSetPos(_WinAPI_GetDlgCtrlID($hTV[1]), $WT + 40, 48, $WC - $WT - 60, $HT) GUICtrlSetPos(_WinAPI_GetDlgCtrlID($hTV[2]), 20, $HT + 96, $WC - 40, $HC - $HT - 116) GUICtrlSetPos($Input[0], 20, 20, $WT) GUICtrlSetPos($Input[1], $WT + 40, 20, $WC - $WT - 60) GUICtrlSetPos($Input[2], 20, $HT + 68, $WC - 40) For $i = 0 To 2 _TVSetPath($Input[$i], _GUICtrlTVExplorer_GetSelected($hTV[$i])) Next Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Example 2 (OnEvent mode) #Include <APIConstants.au3> #Include <GUIConstantsEx.au3> #Include <GUITreeView.au3> #Include <TVExplorer.au3> #Include <TreeViewConstants.au3> #Include <WindowsConstants.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Opt('GUIOnEventMode', 1) Global $hForm, $hTV[3], $Input[3], $hFocus = 0, $Dummy, $Style If Not _WinAPI_DwmIsCompositionEnabled() Then $Style = $WS_EX_COMPOSITED Else $Style = -1 EndIf $hForm = GUICreate('TVExplorer UDF Example', 700, 736, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX), $Style) GUISetOnEvent($GUI_EVENT_CLOSE, '_GUIEvent') GUISetIcon(@WindowsDir & '\explorer.exe') $Input[0] = GUICtrlCreateInput('', 20, 20, 320, 19) GUICtrlSetState(-1, $GUI_DISABLE) $hTV[0] = _GUICtrlTVExplorer_Create(@ProgramFilesDir, 20, 48, 320, 310, -1, $WS_EX_CLIENTEDGE, -1, '_TVEvent') $Input[1] = GUICtrlCreateInput('', 360, 20, 320, 19) GUICtrlSetState(-1, $GUI_DISABLE) $hTV[1] = _GUICtrlTVExplorer_Create(@UserProfileDir, 360, 48, 320, 310, -1, $WS_EX_CLIENTEDGE, -1, '_TVEvent') $Input[2] = GUICtrlCreateInput('', 20, 378, 660, 19) GUICtrlSetState(-1, $GUI_DISABLE) $hTV[2] = _GUICtrlTVExplorer_Create('', 20, 406, 660, 310, -1, $WS_EX_CLIENTEDGE, -1, '_TVEvent') For $i = 0 To 2 _TVSetPath($Input[$i], _GUICtrlTVExplorer_GetSelected($hTV[$i])) _GUICtrlTVExplorer_SetExplorerStyle($hTV[$i]) Next $Dummy = GUICtrlCreateDummy() GUICtrlSetOnEvent(-1, '_GUIEvent') GUIRegisterMsg($WM_GETMINMAXINFO, 'WM_GETMINMAXINFO') GUIRegisterMsg($WM_SIZE, 'WM_SIZE') HotKeySet('{F5}', '_TVRefresh') GUISetState() _GUICtrlTVExplorer_Expand($hTV[0], @ProgramFilesDir & '\AutoIt3') _GUICtrlTVExplorer_Expand($hTV[1]) While 1 Sleep(1000) WEnd Func _GUIEvent() Local $Path Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE GUIDelete() _GUICtrlTVExplorer_DestroyAll() Exit Case $Dummy $Path = _GUICtrlTVExplorer_GetSelected($hFocus) _GUICtrlTVExplorer_AttachFolder($hFocus) _GUICtrlTVExplorer_Expand($hFocus, $Path, 0) $hFocus = 0 EndSwitch EndFunc ;==>_GUIEvent Func _TVEvent($hWnd, $iMsg, $sPath, $hItem) Switch $iMsg Case $TV_NOTIFY_BEGINUPDATE GUISetCursor(1, 1) Case $TV_NOTIFY_ENDUPDATE GUISetCursor(2) Case $TV_NOTIFY_SELCHANGED For $i = 0 To 2 If $hTV[$i] = $hWnd Then _TVSetPath($Input[$i], $sPath) ExitLoop EndIf Next Case $TV_NOTIFY_DBLCLK ; Nothing Case $TV_NOTIFY_RCLICK ; Nothing Case $TV_NOTIFY_DELETINGITEM ; Nothing Case $TV_NOTIFY_DISKMOUNTED ; Nothing Case $TV_NOTIFY_DISKUNMOUNTED ; Nothing EndSwitch EndFunc ;==>_TVEvent Func _TVSetPath($iInput, $sPath) Local $Text = _WinAPI_PathCompactPath(GUICtrlGetHandle($iInput), $sPath, -2) If GUICtrlRead($iInput) <> $Text Then GUICtrlSetData($iInput, $Text) EndIf EndFunc ;==>_TVSetPath Func _TVRefresh() Local $hWnd = _WinAPI_GetFocus() For $i = 0 To 2 If $hTV[$i] = $hWnd Then If Not $hFocus Then $hFocus = $hWnd GUICtrlSendToDummy($Dummy) EndIf Return EndIf Next HotKeySet('{F5}') Send('{F5}') HotKeySet('{F5}', '_TVRefresh') EndFunc ;==>_TVRefresh Func WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) Local $tMMI = DllStructCreate('long Reserved[2];long MaxSize[2];long MaxPosition[2];long MinTrackSize[2];long MaxTrackSize[2]', $lParam) Switch $hWnd Case $hForm DllStructSetData($tMMI, 'MinTrackSize', 428, 1) DllStructSetData($tMMI, 'MinTrackSize', 450, 2) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_GETMINMAXINFO Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) Local $WC, $HC, $WT, $HT Switch $hWnd Case $hForm $WC = _WinAPI_LoWord($lParam) $HC = _WinAPI_HiWord($lParam) $WT = Floor(($WC - 60) / 2) $HT = Floor(($HC - 116) / 2) GUICtrlSetPos(_WinAPI_GetDlgCtrlID($hTV[0]), 20, 48, $WT, $HT) GUICtrlSetPos(_WinAPI_GetDlgCtrlID($hTV[1]), $WT + 40, 48, $WC - $WT - 60, $HT) GUICtrlSetPos(_WinAPI_GetDlgCtrlID($hTV[2]), 20, $HT + 96, $WC - 40, $HC - $HT - 116) GUICtrlSetPos($Input[0], 20, 20, $WT) GUICtrlSetPos($Input[1], $WT + 40, 20, $WC - $WT - 60) GUICtrlSetPos($Input[2], 20, $HT + 68, $WC - 40) For $i = 0 To 2 _TVSetPath($Input[$i], _GUICtrlTVExplorer_GetSelected($hTV[$i])) Next Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE1 point
-
Somewhere along the way, a backslash has been accidentally removed from the ff.au3 code. To solve the issue, change this line: Local $sFFExe = RegRead($sHKLM & "" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe") to: Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe")1 point
-
LAST VERSION - 1.0 12-Jul-10 This library allows to create and manage a pop-up windows are based on your images (transparency also supported). Use this UDF is very simple: create or load the bitmap from a file and display it on desktop screen by using _Popup_Show() function (see example). Run the example that is below, and press SHIFT+1 or SHIFT+2 (several times). iKey and iSwitcher from my sig. also based on this "engine". Try playing with this UDF, and please post any comments and suggestions. Available functions Pop-ups UDF Library v1.0 Previous downloads: 122 Pop-ups.zip Example #Include <GDIPlus.au3> #Include <Pop-ups.au3> Opt('MustDeclareVars', 1) Opt('TrayAutoPause', 0) _GDIPlus_Startup() Global $hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\Image1.png'), $hImage2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\Image2.png') Global $hPopup1 = _Popup_Register(), $hPopup2 = _Popup_Register() HotKeySet('+1', '_Popup1') ; SHIFT+1 HotKeySet('+2', '_Popup2') ; SHIFT+2 While 1 Sleep(1000) WEnd _GDIPlus_Shutdown() Func _Popup1() Local $hGraphic, $hArea, $hBitmap, $hFamily, $hFont, $hFormat, $hBrush, $tLayout, $aData Local $Text = StringFormat('%01d:%02d', @HOUR, @MIN) ; Draw current time (xx:xx) on "Image1.png" and create bitmap $hArea = _GDIPlus_BitmapCloneArea($hImage1, 0, 0, 133, 133, $GDIP_PXF32ARGB) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hArea) $hFamily = _GDIPlus_FontFamilyCreate('Tahoma') $hFont = _GDIPlus_FontCreate($hFamily, 38, 0, 2) $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) $hFormat = _GDIPlus_StringFormatCreate() $hBrush = _GDIPlus_BrushCreateSolid(0xC0FFFFFF) _GDIPlus_GraphicsSetTextRenderingHint($hGraphic, 3) $aData = _GDIPlus_GraphicsMeasureString($hGraphic, $Text, $hFont, $tLayout, $hFormat) $tLayout = $aData[0] DllStructSetData($tLayout, 1, (133 - DllStructGetData($tLayout, 3)) / 2) DllStructSetData($tLayout, 2, (133 - DllStructGetData($tLayout, 4)) / 2) _GDIPlus_GraphicsDrawStringEx($hGraphic, $Text, $hFont, $aData[0], $hFormat, $hBrush) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hArea) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_FontDispose($hFont) _GDIPlus_BrushDispose($hBrush) _GDIPlus_ImageDispose($hArea) ; Show pop-up image _Popup_Show($hPopup1, $hBitmap, 1) EndFunc ;==>_Popup1 Func _Popup2() ; Show or hide pop-up image ("Image2.png") If Not _Popup_IsActive($hPopup2) Then _Popup_Show($hPopup2, _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage2), 1, @DesktopWidth - 90, @DesktopHeight - 110, -1) Else _Popup_Hide($hPopup2) EndIf EndFunc ;==>_Popup2 #Region GDI+ Functions Func _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $iTextRenderingHint) Local $aResult = DllCall($ghGDIPDll, 'uint', 'GdipSetTextRenderingHint', 'ptr', $hGraphics, 'int', $iTextRenderingHint) If @error Then Return SetError(1, 0, 0) Else If $aResult[0] Then Return SetError($aResult[0], 0, 0) EndIf EndIf Return 1 EndFunc ;==>_GDIPlus_GraphicsSetTextRenderingHint #EndRegion GDI+ Functions1 point
-
Currency Exchange Converter
jaberwacky reacted to MrCreatoR for a topic
Ok, here it is, it's my rewrited version. Now it's uses gocurrency.com to get update, much much faster. Currency_Exchange_Conveter_src.zip1 point -
Thanks for the tip! But both ways are right aren't they? OR not? I only posted because some users will ask this question and now I have a reference post.1 point
-
Open Explorer
ViditGupta reacted to Ascend4nt for a topic
Even better, select the file or folder you want. Example: Run("explorer.exe /n,/e,/select,C:\Windows\notepad.exe")1 point