PlayHD Posted February 4, 2013 Share Posted February 4, 2013 (edited) Hey .I have a little problem ..I want to make a window with a child with _WinApi_SetParrent(..), it works fine.But i have a little problem, when i try to make child of a pic is not working fine...Pic : LinkHere is my project : Test.rarps. sorry for my english Edited February 6, 2013 by PlayHD My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit Link to comment Share on other sites More sharing options...
martin Posted February 4, 2013 Share Posted February 4, 2013 I am unable to open your Test.rsr. 7zip fails and camunzip tells me that it the the first of more than one floppy. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
PlayHD Posted February 5, 2013 Author Share Posted February 5, 2013 Try now : Test.7z My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit Link to comment Share on other sites More sharing options...
martin Posted February 6, 2013 Share Posted February 6, 2013 Still no good. ANyway,, if the zip is 126 k then the code is more than I want to deal with. Could you make a small example script and post that, then it will be a lot easier for us. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 6, 2013 Moderators Share Posted February 6, 2013 martin,I can download it - the original script is:#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinApi.au3> #include <Icons.au3> $Form = GUICreate("Test", 600, 400) Global $Pic = GUICtrlCreatePic("", 50, 40, 500, 300, -1, $WS_EX_CLIENTEDGE) _SetImage($Pic,"Bk.png") GUISetState(@SW_SHOW,$Form) $cForm = GUICreate("Test", 100, 100,1,1,$WS_SizeBox) _WinAPI_SetParent($cForm,GUICtrlGetHandle($Pic)) GUISetState(@SW_SHOW,$cForm) ;~ GUIRegisterMsg($WM_MOVE, "_WM_MOVE_SIZE") GUIRegisterMsg($WM_SIZE, "_WM_MOVE_SIZE") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_MOVE_SIZE($hWnd, $Msg, $wParam, $lParam) _SetImage($Pic,"Bk.png") EndFuncplus Yashied's Icons UDF and a 3MB .png file.But quite what the OP thinks he is doing in that script is beyond me - setting an image within a WM_SIZE handler? 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...
UEZ Posted February 6, 2013 Share Posted February 6, 2013 (edited) @martin: Here the code runable: expandcollapse popup#include <WindowsConstants.au3> #include <Constants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Global Const $STM_SETIMAGE = 0x0172 _GDIPlus_Startup() $hBitmap = _GDIPlus_ScaleImage2(@ScriptDir & "\Bk.png", 500, 300) $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) $Form = GUICreate("Test", 600, 400) Global $Pic = GUICtrlCreatePic("", 50, 40, 500, 300, -1, $WS_EX_CLIENTEDGE) $hB = GUICtrlSendMsg($Pic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap) If $hB Then _WinAPI_DeleteObject($hB) GUISetState(@SW_SHOW,$Form) $cForm = GUICreate("Test", 100, 100,1,1,$WS_SizeBox) _WinAPI_SetParent($cForm,GUICtrlGetHandle($Pic)) GUISetState(@SW_SHOW,$cForm) ;~ GUIRegisterMsg($WM_MOVE, "_WM_MOVE_SIZE") ;~ GUIRegisterMsg($WM_SIZE, "_WM_MOVE_SIZE") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hHBitmap) _GDIPlus_Shutdown() Exit EndSwitch WEnd Func _WM_MOVE_SIZE($hWnd, $Msg, $wParam, $lParam) $hB = GUICtrlSendMsg($Pic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hB = ' & $hB & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console If $hB Then _WinAPI_DeleteObject($hB) EndFunc Func _GDIPlus_ScaleImage2($sFile, $iNewWidth, $iNewHeight, $iBGColor = 0xFFF0F0F0, $bBGClear = True, $iInterpolationMode = 7) ;coded by UEZ 2012 If Not FileExists($sFile) Then Return SetError(1, 0, 0) Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) If @error Then Return SetError(2, 0, 0) Local $iWidth = _GDIPlus_ImageGetWidth($hImage) Local $iHeight = _GDIPlus_ImageGetHeight($hImage) Local $iW, $iH, $f, $fRatio If $iWidth > $iHeight Then $f = $iWidth / $iNewWidth Else $f = $iHeight / $iNewHeight EndIf $iW = Int($iWidth / $f) $iH = Int($iHeight / $f) If $iW > $iNewWidth Then $fRatio = $iNewWidth / $iW $iW = Int($iW * $fRatio) $iH = Int($iH * $fRatio) ElseIf $iH > $iNewHeight Then $fRatio = $iNewHeight / $iH $iW = Int($iW * $fRatio) $iH = Int($iH * $fRatio) EndIf Local $hBitmap = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) If @error Then Return SetError(3, 0, 0) $hBitmap = $hBitmap[6] Local $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) If $bBGClear Then _GDIPlus_GraphicsClear($hBmpCtxt, $iBGColor) DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hBmpCtxt, "int", $iInterpolationMode) _GDIPlus_GraphicsDrawImageRect($hBmpCtxt, $hImage, 0, 0, $iW, $iH) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hBmpCtxt) Return $hBitmap EndFunc @PlayHD: the problem is the transparent image. If you convert it you must clear the background of the gdi+ image otherwise you will see the effect. Br, UEZ Edited February 6, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
PlayHD Posted February 6, 2013 Author Share Posted February 6, 2013 works great Thanks UEZ. My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit 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