Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/11/2022 in all areas

  1. Hi I don't know if this is the right place for this but I thought it might come in useful to someone and I couldn't find it while I was searching for posts that address it. This: Global $exampleGUI = GUICreate("Rounded corners", 400, 300, -1, -1) Will automatically get rounded corners in Windows 11... But this: Global $exampleGUI = GUICreate("Rounded corners", 400, 300, -1, -1, $WS_POPUP) Will not. I usually like to ditch the windows title bar and replace it with my own, so it was annoying, that on Windows 11, my stuff didn't look the part. The trick is to use DwmSetWindowAttribute to set DWMWA_WINDOW_CORNER_PREFERENCE (33) to DWMWCP_ROUND (2) as explained here: Apply rounded corners in desktop apps for Windows 11 I modified the function in WinAPIGdi.au3 to accept 33 as a valid parameter and used the function from there: Func _WinAPI_DwmSetWindowAttribute($hWnd, $iAttribute, $iData) Switch $iAttribute Case 2, 3, 4, 6, 7, 8, 10, 11, 12, 33 Case Else Return SetError(1, 0, 0) EndSwitch Local $aCall = DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hWnd, 'dword', $iAttribute, _ 'dword*', $iData, 'dword', 4) If @error Then Return SetError(@error, @extended, 0) If $aCall[0] Then Return SetError(10, $aCall[0], 0) Return 1 EndFunc ;==>_WinAPI_DwmSetWindowAttribute Example: #include <WinAPIGdi.au3> #include <GUIConstantsEx.au3> #include <Windowsconstants.au3> Global $exampleGUI = GUICreate("Rounded corners", 400, 300, -1, -1, $WS_POPUP) _WinAPI_DwmSetWindowAttribute($exampleGUI,33,2) Local $label = GUICtrlCreateLabel(" This is an example.", 50, 150,200, 50) GUISetState(@SW_SHOW, $exampleGUI) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd
    1 point
  2. CoePSX

    Drawing script

    Hi I've been working on this script in the last few days, and although it's not so small, I believe it can serve a few coding examples and provide some fun. It's idea is simple: It reads an image, makes it b/w, and using the mouse it draws this image. I made this to draw images on handwrite messages in MSN, but it can be tested in Paint or any other image editor. The image processing is done by capturing the image, and using the GetBitmapBits API to get the pixels' colors. Based on the pixels color and the set sensitivity, it will be either black or white (the black part is the one that is going to be drawn). The drawing was a little bit harder to get working on big images. To make it look more like drawing than like printing, the script draws black areas using recursion. In big areas this would overflow the call stack, so I use an array as a custom stack. The random drawing pattern is my favorite. This is practically useless, but I have a lot of fun using this in MSN. But people don't believe I draw that good... drawingscript.au3 mae.bmp
    1 point
  3. KaFu

    Media Player Embedding

    Maybe something like this (untested). Func _MP_PlaylistRemoveItem($iIndex) ; https://docs.microsoft.com/de-de/windows/win32/wmp/wmplibiwmpplaylist-iwmpplaylist-removeitem--vb-and-c Local $oWMP = $aPlayerReg[$PREG_PLROBJ] Local $oPlaylist = $oWMP.CurrentPlaylist $oWMP.CurrentPlayList.RemoveItem($oPlaylist.Item($iIndex)) EndFunc ;==>_MP_PlaylistRemoveItem
    1 point
×
×
  • Create New...