Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/12/2024 in all areas

  1. Another approach : #include <GUIConstants.au3> #include <GuiMenu.au3> HotKeySet("{F3}", ShowMenu) HotKeySet("^{F3}", Terminate) While Sleep(100) WEnd Func ShowMenu() Local Static $bCreated = False Local Static $hGUI = GUICreate("", 50, 50, -100, -100, $WS_POPUP, $WS_EX_TOOLWINDOW) Local Static $idContextmenu = GUICtrlCreateContextMenu() Local Static $idNew = GUICtrlCreateMenuItem("New", $idContextmenu) Local Static $idOpen = GUICtrlCreateMenuItem("Open", $idContextmenu) Local Static $idSave = GUICtrlCreateMenuItem("Save", $idContextmenu) If Not $bCreated Then GUICtrlCreateMenuItem("", $idContextmenu) ; separator Local Static $idInfo = GUICtrlCreateMenuItem("Info", $idContextmenu) Local Static $hMenu = GUICtrlGetHandle($idContextmenu) $bCreated = True GUISetState() Switch _GUICtrlMenu_TrackPopupMenu($hMenu, $hGUI, -1, -1, 1, 1, 2) Case $idNew ConsoleWrite("New" & @CRLF) Case $idOpen ConsoleWrite("Open" & @CRLF) Case $idSave ConsoleWrite("Save" & @CRLF) Case $idInfo ConsoleWrite("Info" & @CRLF) EndSwitch GUISetState(@SW_HIDE) EndFunc ;==>ShowMenu Func Terminate() Exit EndFunc ;==>Terminate
    2 points
  2. pixelsearch, ioa747 thank you for trying to help!!! It seems to me that it is impossible to remove the rest of the header. That would be great though. (painting in one color is not suitable) For now, the solution is to create a separate shadow (maybe someone find it useful): #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> #include <GDIPlus.au3> #include <WinAPISysWin.au3> ;exit func HotKeySet('{ESC}', 'Terminate') Func Terminate() Exit EndFunc ;==>Terminate $hGUI_Shadow = GUICreate('', 0, 0, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) $hGUI = GUICreate('', 400, 400, 300, 300, $WS_POPUP, Default, $hGUI_Shadow) GUISetBkColor($COLOR_RED, $hGUI) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hGUI_Shadow) ;create shadow :) _GDIPlus_Startup() _WinAPI_UpdateLayeredWindowEx($hGUI_Shadow, 300-20, 300-20, _CreateDropShadow(400, 400, 20, 0xFF000000), 60, 1) _GDIPlus_Shutdown() While Sleep(1000) WEnd ;============== code by Yashied (author) ==================== Func _CreateDropShadow($iWidth, $iHeight, $iRadius, $iARGB = 0) Local $hGraphic, $hBrush, $hImage, $hBitmap Local $aPart[4][5] = _ [[$iRadius, 0, $iWidth, $iRadius, -90], _ [$iWidth + $iRadius, $iRadius, $iRadius, $iHeight, 0], _ [$iRadius, $iHeight + $iRadius, $iWidth, $iRadius, 90], _ [0, $iRadius, $iRadius, $iHeight, 180]] $hImage = _GDIPlus_BitmapCreateFromScan0($iWidth + 2 * $iRadius, $iHeight + 2 * $iRadius) If Not $hImage Then Return 0 EndIf $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsClear($hGraphic, 0) $hBrush = _GDIPlus_BrushCreateSolid($iARGB) _GDIPlus_GraphicsFillRect($hGraphic, $iRadius, $iRadius, $iWidth, $iHeight, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iRadius, $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), -180, -90) _GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iWidth + $iRadius, $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), -90, 0) _GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iWidth + $iRadius, $iHeight + $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), 0, 90) _GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iRadius, $iHeight + $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), 90, 180) For $i = 0 To 3 $tRect = DllStructCreate($tagGDIPRECTF) For $j = 0 To 4 DllStructSetData($tRect, $j + 1, $aPart[$i][$j]) Next $hBrush = _GDIPlus_LineBrushCreateFromRectWithAngle($tRect, $iARGB, BitAND($iARGB, 0x00FFFFFF), $aPart[$i][4], 0, 3) _GDIPlus_GraphicsFillRect($hGraphic, $aPart[$i][0], $aPart[$i][1], $aPart[$i][2], $aPart[$i][3], $hBrush) _GDIPlus_BrushDispose($hBrush) Next $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) Return $hBitmap EndFunc ;==>_CreateDropShadow Func _GDIPlus_GraphicsDrawRadialGradient($hGraphics, $iX, $iY, $iRadius, $iARGB1, $iARGB2, $iStartAngle = 0, $iEndAngle = 360, $iStep = 5) If $iStep < 1 Then $iStep = 1 EndIf Local $Xi = $iX - $iRadius, $Yi = $iY - $iRadius, $Di = 2 * $iRadius Local $hBrush, $hMatrix, $Smooth = _GDIPlus_GraphicsGetSmoothingMode($hGraphics) Local $Start = True _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 0) $hBrush = _GDIPlus_LineBrushCreate(0, 0, $iRadius, 0, $iARGB1, $iARGB2, 3) $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $iX, $iY) While $iStartAngle < $iEndAngle If $iStartAngle + $iStep > $iEndAngle Then $iStep = $iEndAngle - $iStartAngle EndIf If $Start Then _GDIPlus_MatrixRotate($hMatrix, $iStartAngle + $iStep / 2) $Start = False Else _GDIPlus_MatrixRotate($hMatrix, $iStep) EndIf _GDIPlus_LineBrushSetTransform($hBrush, $hMatrix) _GDIPlus_GraphicsFillPie($hGraphics, $Xi, $Yi, $Di, $Di, $iStartAngle, $iStep, $hBrush) $iStartAngle += $iStep WEnd _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $Smooth) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_BrushDispose($hBrush) Return 1 EndFunc ;==>_GDIPlus_GraphicsDrawRadialGradient sorry for my english...
    2 points
  3. for the example I took a piece from https://www.autoitscript.com/forum/topic/208404-scite-plusbar/?do=findComment&comment=1513490 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $MyIni = StringTrimRight(@ScriptFullPath, 4) & ".ini" Global $MyName = StringTrimRight(@ScriptName, 4) ConsoleWrite("$MyName=" & $MyName & @CRLF) HotKeySet("{F3}", "_MyConex") ;********************************** While 1 Sleep(50) WEnd ;********************************** Func _MyConex() Global $mPos = MouseGetPos() Global $hGui = GUICreate("Fav_gui", 32, 32, $mPos[0], $mPos[1], $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) GUISetBkColor("0x000000") WinSetTrans($hGui, "", 2) ;Add FileChangeDir to set the workdir to the scriptdir FileChangeDir(@ScriptDir) ;~ Global $aBox = BoxLoad() #Region === ContextMenu === Global $hMenu = GUICtrlCreateContextMenu() Global $Menu_Add = GUICtrlCreateMenuItem("➕ Add To " & $MyName, $hMenu) Global $Menu_Remove = GUICtrlCreateMenuItem("➖ Remove From " & $MyName, $hMenu) GUICtrlCreateMenuItem("", $hMenu) ; separator ------------------------------------- Global $Menu_Edit = GUICtrlCreateMenuItem("⚙ Edit " & $MyName, $hMenu) GUICtrlCreateMenuItem("", $hMenu) ; separator ------------------------------------- ;~ For $i = 1 To $aBox[0][0] ;~ GUICtrlCreateMenuItem($aBox[$i][0], $hMenu) ;~ Next GUICtrlCreateMenuItem("", $hMenu) ; separator ------------------------------------- Global $Menu_Cancel = GUICtrlCreateMenuItem("Cancel", $hMenu) #EndRegion === ContextMenu === GUISetState(@SW_SHOW) ; Perform a mouse right click MouseClick("right") Global $ID, $TmpSciteFile, $NeedSave = False ; Loop until the user exits. ;******************************************************************** While 1 $ID = GUIGetMsg() Switch $ID Case $GUI_EVENT_CLOSE ExitLoop Case $Menu_Add ;... ExitLoop Case $Menu_Remove ;... ExitLoop Case $Menu_Edit ;... ExitLoop Case $Menu_Cancel ExitLoop ;~ Case 8 To $aBox[0][0] + 9 ;~ ExitLoop EndSwitch If Not WinActive($hGui) Then ExitLoop EndIf WEnd ;******************************************************************** EndFunc ;==>_MyConex
    2 points
  4. MattyD

    Midi UDF

    Hi all, Attached below are two segments of this project. The first "Midi API" is a wrap of the windows functions below. https://docs.microsoft.com/en-us/windows/win32/multimedia/midi-functions The second "Midi UDF" library is built on the first, and aims to provide a user friendly code base for people working with midi. This UDF so far covers: Channel Voice and Mode Messaging Registered Parameters (Channel Tuning, Mod Wheel/Pitch Bend ranges) Some prolific Non-Registered Parameters. Drum editing Envelope control Vibrato control Filter control General SysEx messaging Roland Data Transfer (DT1/RQ1) Yamaha XG Data Transfer & SysEx Parameter Control Global parameter control (GM2 Reverb & Chorus control) Device Control (Master Volume/Balance/Tuning) Octive/Scale Tuning Controller Destination settings (aftertouch/cc modulation editing) Active Sensing for Output Devices 3D Sound Controllers Midi Show Control - General Commands Importing and exporting midi files (experimental) Recording midi event sequences. (experimental) Midi Machine Control is currently not supported. Thank yous A quick shoutout shoutout to Water and Mr_Creator for the Simple Library Docs Generator - which was the originaly the basis of the helpfiles. Also a double to Water for the advanced help example (f1 key integration with scite). A couple of notes on synths. I've based the UDF on a couple of different RPs published many years apart, so implementation can be quite instrument specific. Don't expect too much of the builtin MS Wavetable Synth! I've had some more joy with the coolsoft midisynth with the choriumRevA soundfont if anyone is looking for a free alternative to test with. The two software synths mentioned above are also very slow responding to midi messages. If you forward messages to a physical instrument you should be able to play in real time. Previous versions: If anyone is after a previous release, they are all available on the sourceforge page. midi.zip
    1 point
  5. Version 0.2411.14.2

    44 downloads

    I use dark mode and would love to have the border with colors of my choosing. While I wait for Windows to implement a user selectable option in their settings, I cooked my own "border color setter". Since am at it, chose to have a color for elevated/admin windows and another for user level GUIs. Or not, is user selectable. Win11myOwnBorderColor.exe (v0.2411.14.2) SHA-1: 8EC62A330C489016E0F142A49E757FB696B3F4E1 SHA-256: D8CF3A723281A5EBAD8FED60898CE7F2410DC1E8EA9B88935D6D39257D0676D9 I wrote a FAQ / Help to give an idea of how to use it. That is very intuitive once you use it. But is there to read if you have questions. If the answers don't cover your question, join the forum and make a post for your question on the thread.
    1 point
  6. These border colors are set by the app every time the window is created. The example for this is already posted. Since this is more of an app than an example, I opened a thread here for support. The script and compilation to .exe is the files area for download. According to Microsoft, the possibility to set the border color is available from Windows 11 Build 22000 onwards.
    1 point
  7. Wow. Claude Sonnet 3.5 doesn't fail to impress me! Func EncodeUnicode($sText) Local $aResult = "" Local $iLen = StringLen($sText) Local $i = 1 While $i <= $iLen Local $iCode = AscW(StringMid($sText, $i, 1)) ; Check if this is a high surrogate (first part of surrogate pair) If $iCode >= 0xD800 And $iCode <= 0xDBFF And $i < $iLen Then ; Get the low surrogate (second part) Local $iLowSurrogate = AscW(StringMid($sText, $i + 1, 1)) If $iLowSurrogate >= 0xDC00 And $iLowSurrogate <= 0xDFFF Then ; Valid surrogate pair - encode both parts $aResult &= "\u" & StringLower(Hex($iCode, 4)) & "\u" & StringLower(Hex($iLowSurrogate, 4)) $i += 2 ; Skip the next character as weve already processed it ContinueLoop EndIf EndIf ; Handle regular characters If $iCode > 127 Then $aResult &= "\u" & StringLower(Hex($iCode, 4)) Else $aResult &= StringMid($sText, $i, 1) EndIf $i += 1 WEnd Return $aResult EndFunc ; Helper function to test the encoding Func TestEncoding() Local $aTestCases[][2] = [ _ ["🐒", "\ud83d\udc12"], _ ["💧", "\ud83d\udca7"], _ ["Hello 👋 World", "Hello \ud83d\udc4b World"], _ ["🌍", "\ud83c\udf0d"], _ ["😀", "\ud83d\ude00"] _ ] For $i = 0 To UBound($aTestCases) - 1 Local $sInput = $aTestCases[$i][0] Local $sExpected = $aTestCases[$i][1] Local $sResult = EncodeUnicode($sInput) ConsoleWrite("Input: " & $sInput & @CRLF) ConsoleWrite("Expected: " & $sExpected & @CRLF) ConsoleWrite("Got: " & $sResult & @CRLF) ConsoleWrite("Match: " & ($sResult = $sExpected) & @CRLF & @CRLF) Next EndFunc
    1 point
  8. You can compare code by yourself. But to help you understand, I use _GUICtrlMenu_TrackPopupMenu to show the context menu instead of using a right-click. Which in my perspective is way more robust and much cleaner (no offense to @ioa747) ps. also by using Static controls, you do not need to create the GUI each time you press F3. It is created once, and you reuse it as often as you want.
    1 point
  9. @ioa747 Thank you very much for this. It does everything I wanted. I was just expecting how to initiate the context menu, but you have my hotkey and everything. Reading through this, It looks like you basically create a transparent gui that you right click on which initiates the context menu. Clever!
    1 point
  10. Results on my computer, in the pic above : * Left = OP's script (white border fully visible in this Popup GUI having a size border) * Mid = WM_NCPAINT with a Pen having a width of 1 unit (only a part of the border is red) * Right = WM_NCPAINT with a Pen having a width of 5 units (all the border is red) For what it's worth...
    1 point
  11. I tried it, I also put another color so that it is visible, but I can't see it anywhere. I'm still searching
    1 point
  12. @ioa747 unfortunately it happens that scripts which work very fine with oldest OS's (my computer) don't work anymore with new OS's. I won't be able to test it on a Win11 machine until Sunday, but as you wrote it doesn't work on Win10 then it probably won't work on Win11 Here is the link of the script (from rasim) that I used to rescript what's in my preceding post.
    1 point
  13. Hi ioa747, maybe he can't do this, because the GUI should stay resizable ? Does the following script work for you, registering WM_NCPAINT to paint the GUI frame when needed : #include <ColorConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> Global $g_iGuiBkColor = $COLOR_RED $hGUI = GUICreate('', 400, 300, -1, -1, BitOR($WS_POPUP, $WS_THICKFRAME)) ; $WS_THICKFRAME same as $WS_SIZEBOX GUISetBkColor($g_iGuiBkColor, $hGUI) GUIRegisterMsg($WM_NCPAINT, "WM_NCPAINT") ; before GUISetState (+++) . Interesting to test it just after GUISetState ! GUISetState(@SW_SHOW, $hGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Esc will terminate (as no close button in this GUI) ;============================================ Func WM_NCPAINT($hWnd, $iMsg, $wParam, $lParam) Local $hDC, $hPen, $OldPen, $hBrush, $OldBrush, $aHwndPos, $tRECT $hDC = _WinAPI_GetWindowDC($hWnd) $hPen = _WinAPI_CreatePen($PS_SOLID, 5, _RGB2BGR($g_iGuiBkColor)) ; 5 should be enough for a thick GUI border $OldPen = _WinAPI_SelectObject($hDC, $hPen) $hBrush = _WinAPI_GetStockObject($NULL_BRUSH) ; same as $HOLLOW_BRUSH $OldBrush = _WinAPI_SelectObject($hDC, $hBrush) $aHwndPos = WinGetPos($hWnd) $tRECT = _WinAPI_CreateRect(1, 1, $aHwndPos[2], $aHwndPos[3]) _WinAPI_Rectangle($hDC, $tRECT) ; draw the rectangle _WinAPI_SelectObject($hDC, $OldBrush) _WinAPI_SelectObject($hDC, $OldPen) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC($hWnd, $hDC) Return 0 ; works (GUI border got the same color as GUI background color) ; Return 1 ; works ; Return $GUI_RUNDEFMSG ; doesn't work (GUI border is visible in its native color) ; Return ; doesn't work (i think Return $GUI_RUNDEFMSG or Return always have the same effect) EndFunc ;==>WM_NCPAINT ;============================================ Func _RGB2BGR($iColor) Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF) EndFunc ;==>_RGB2BGR
    1 point
  14. Not a huge fan of creating a new label every time a button is clicked. Seems unnecessary and a recipe for a memory leak. Am I missing something?
    1 point
  15. How about...(the but_check_all) #include <GUIConstants.au3> Local $hGUI = GUICreate ( "Test" , 300 , 250 ) Local $But_check_1 = GUICtrlCreateButton ( "Button 1" , 10 , 10 , 50 , 20 ) Local $But_check_2 = GUICtrlCreateButton ( "Button 2" , 10 , 40 , 50 , 20 ) Local $But_check_3 = GUICtrlCreateButton ( "Button 3" , 10 , 70 , 50 , 20 ) Local $But_check_4 = GUICtrlCreateButton ( "Button 4" , 10 , 100 , 50 , 20 ) Local $But_check_5 = GUICtrlCreateButton ( "Button 5" , 10 , 130 , 50 , 20 ) Local $But_check_All = GUICtrlCreateButton ( "Button All" , 10 , 170 , 50 , 20 ) GUISetState ( ) While True Switch GUIGetMsg ( ) Case $GUI_EVENT_CLOSE ExitLoop Case $But_check_1 ;Do something Case $But_check_2 ;Do something Case $But_check_3 ;Do something Case $But_check_4 ;Do something Case $But_check_5 ;Do something Case $But_check_All ControlClick($hGUI, "", "Button 1") ControlClick($hGUI, "", "Button 2") ControlClick($hGUI, "", "Button 3") ControlClick($hGUI, "", "Button 4") ControlClick($hGUI, "", "Button 5") EndSwitch WEnd Or in one line... BitAND(ControlClick($hGUI, "", "Button 1"), ControlClick($hGUI, "", "Button 2"), ControlClick($hGUI, "", "Button 3"), ControlClick($hGUI, "", "Button 4"), ControlClick($hGUI, "", "Button 5"))
    1 point
  16. I think Dan's recommendation isn't bad, but adds more complexity to account for. I would recommend creating a function/routine for each button case; something like this: case $But_check_1 But1() case $But_check_2 But2() case $But_check_3 But3() case $But_check_4 But4() case $But_check_5 But5() Func But1() ;button 1 code... ;... ;... EndFunc Func But2() ;button 2 code... ;... ;... EndFunc Func But3() ;button 3 code... ;... ;... EndFunc Func But4() ;button 4 code... ;... ;... EndFunc Func But5() ;button 5 code... ;... ;... EndFunc then calling the functions directly in order: But1() But2() But3() But4() But5()
    1 point
  17. If you want to run 5 different code things with only one button increase a variable with each click, then use the switch command to run the code ... something like: #include <GUIConstants.au3> Local $hGUI = GUICreate ( "Test" , 300 , 50 ) Local $idButton = GUICtrlCreateButton ( "LetsGo" , 0 , 0 , 50 , 20 ) GUICtrlSetBkColor($idButton, 0xf0f0f0) GUISetState ( ) $stage=-1 While True Switch GUIGetMsg ( ) Case $GUI_EVENT_CLOSE ExitLoop Case $idButton $stage=$stage+1 Switch $stage case 0 WinSetTitle ($hGUI,"","Stage 0") GUICtrlSetBkColor($idButton, 0xfff00) case 1 WinSetTitle ($hGUI,"","Stage 1") GUICtrlSetBkColor($idButton, 0xffff80) case 2 WinSetTitle ($hGUI,"","Stage 2") GUICtrlSetBkColor($idButton, 0x00ffff) case 3 $stage=-1 GUICtrlSetBkColor($idButton, 0xf0f0f0) WinSetTitle ($hGUI,"","Test") EndSwitch EndSwitch WEnd if you need to run it all in a single click ... place the code in 5 functions then do: case $But_check_1 func1() func2() func3() func4() func5()
    1 point
  18. What Melba was trying to convey is you shouldn't have to click each button, but instead run the code that occurs when a button click Msg is detected. I imagine you have some code beneath each case...is that correct? case $But_check_1 ;button 1 code... ;... ;... case $But_check_2 ;button 2 code... ;... ;... case $But_check_3 ;button 3 code... ;... ;... case $But_check_4 ;button 4 code... ;... ;... case $But_check_5 ;button 5 code... ;... ;...
    1 point
  19. I'm going to use these menus. I've updated the UDF, ModernMenuRaw.au3. Of the posts it appears that Holger updated the code on a regular basis until May 2008. ProgAndy made some updates in August 2008. These updates were about the background color of the menubar, the ability to use icon handles, and better cleanup code on exit. The updates I've made are based on the UDF by ProgAndy attached to post 213. It's my intention to update the UDF to make it run under the current versions of AutoIt, and to get rid of errors. Especially already known errors, which can be fixed in a few lines of code. It's not my intention to add a lot of new code to the UDF. Updates 2014-10-18 This update is based on original code by Holger (first post) and updates by ProgAndy (posts 211 - 213). The update supports AutoIt 3.3.10 and later. Code relating to Windows versions not supported by 3.3.10 is deleted. WindowsConstants.au3 is included and double-defined global constants are commented out. Added an update to be able to use colored controls e.g. buttons with this UDF. Post 222. Update (one line) for x64 support. Post 266 by Holger. Added x64 support to functions by ProgAndy. Declared a few local variables. Updates 2014-10-19 Updates to pass Au3Check. (-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6) Updates 2015-01-24 Updates for tray menus suggested by nickston (posts 298, 299, 312) Most important is an update that makes it possible to use a flashing tray menu icon. There are also a few code optimizations. Updates 2021-11-12 Disabled $IDI_ global constants in ModernMenuRaw.au3. $IDI_ constants are included in AutoItConstants.au3. None of the updates above are script breaking. If you are using tray menus and want to compile your script, you should pay attention to posts 268 - 270. Note also that _TrayIconCreate creates a GUI to receive messages from tray icons. After calling this function you should probably use GUISwitch($hGui) or something. Post 227. In the top of ModernMenuRaw.au3 I've included commands.txt from the original zip by Holger. Two commands of ProgAndy to handle the background color of the menubar are added. I've also added an alphabetical list of functions, and a list of Windows messages (used with GUIRegisterMsg). Examples In order to make it easy the examples are included in the zip. The original examples by Holger are included with no changes at all. The 32 examples by AZJIO in the post above are also included with no changes. There are two versions of the examples: an english and a russian. The examples demonstrates the commands one by one and are named with the name of the command. Copied an example by AZJIO and renamed it to _TrayIconSetState-flashing.au3. Added one line of code to make the tray menu icon flash. Only an english version. A new example by nickston that demonstrates a flashing tray menu icon. The example shows how to turn flashing on and off. Two new examples _GUICtrlCreateODTopMenu.au3 and _GUIMenuBarSetBkColor.au3 that demonstrates the commands by ProgAndy to set the background color of the menubar. _GUIMenuBarSetBkColor.au3 is not working on Windows 7. A new example that shows how to use a bitmap from an image list as an icon in a menu item. The example shows also how to use icon handles. 7z-file ModernMenuRaw.au3 - update on 12.11.2021 ModernMenuRaw.au3 - all previous versions ExamplesAZJIO - 32 examples by AZJIO in english and russian versions ExamplesHolger - the original examples by Holger Examplesnickston - flashing tray menu icon ExampleszNew - three new examples Tested with AutoIt 3.3.10 on Windows 7 32/64 bit and Windows XP 32 bit. 2014-10-19: ModernMenuRaw.7z 2015-01-24: ModernMenuRaw.7z Tested with AutoIt 3.3.14.2/5 and beta 3.3.15.4 on Windows 7/10 32/64 bit. ModernMenuRaw.7z
    1 point
  20. AdmiralAlkex Hi! Try this: #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global Const $PS_SOLID = 0 $hGUI = GUICreate("TEST", 320, 240, -1, -1, BitOR($WS_POPUP, $WS_SIZEBOX)) GUISetBkColor(0x000000) GUIRegisterMsg($WM_NCPAINT, "WM_NCPAINT") GUISetState() Do Until GUIGetMsg() = -3 Func WM_NCPAINT($hWnd, $Msg, $wParam, $lParam) Local $hDC, $hPen, $OldPen, $OldBrush, $aHwndPos $hDC = _WinAPI_GetWindowDC($hWnd) $hPen = DllCall("gdi32.dll", "hwnd", "CreatePen", "int", $PS_SOLID, "int", 5, "int", 0x0000FF) $hPen = $hPen[0] $OldPen = _WinAPI_SelectObject($hDC, $hPen) $OldBrush = _WinAPI_SelectObject($hDC, _WinAPI_GetStockObject($NULL_BRUSH)) $aHwndPos = WinGetPos($hWnd) DllCall("gdi32.dll", "int", "Rectangle", "hwnd", $hDC, "int", 1, "int", 1, "int", $aHwndPos[2], "int", $aHwndPos[3]) _WinAPI_SelectObject($hDC, $OldBrush) _WinAPI_SelectObject($hDC, $OldPen) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC($hWnd, $hDC) Return True EndFunc
    1 point
×
×
  • Create New...