crashtuak
08-08-2009, 19:05
Вот есть код:
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <GuiConstantsEx.au3>
#include <ProgressConstants.au3>
#Include <Array.au3>
#Region ### START Koda GUI section ### Form=
Global $hGUI, $hImage, $hGraphic, $hImage1
$hGUI = GUICreate("Form1", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetState()
; Load PNG image
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\item.png")
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\background.bmp")
; Draw PNG image
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 0, 0, @DesktopWidth, @DesktopHeight )
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, @DesktopWidth/2-336, @DesktopHeight/2-256)
; Draw PNG complete
$Progress1 = GUICtrlCreateProgress(@DesktopWidth/2-203, @DesktopHeight/2+10, 400, 25)
#EndRegion ### END Koda GUI section ###
#Region ### Do install ###
$sectionnames = IniReadSectionNames ( @ScriptDir & "\config.ini" )
$itemcount = _ArrayMax($sectionnames)
For $i = 1 to $itemcount Step 1
$runpath = @ScriptDir & "\install\" & IniRead ( @ScriptDir & "\config.ini", "Item_" & $i, "install", "default" )
RunWait ($runpath )
GUICtrlSetData ( $Progress1, GUICtrlRead ($Progress1)+ 100/$itemcount)
Next
MsgBox(0,"", "Установка завершена!")
#EndRegion ### End Install ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
GDIPlus все рисует как надо, но когда над окном появляются какието другие окна или меседж боксы мы получаем то что видим на приатаченом скрине. Как избежать такой гадости?
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <GuiConstantsEx.au3>
#include <ProgressConstants.au3>
#Include <Array.au3>
#Region ### START Koda GUI section ### Form=
Global $hGUI, $hImage, $hGraphic, $hImage1
$hGUI = GUICreate("Form1", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetState()
; Load PNG image
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\item.png")
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\background.bmp")
; Draw PNG image
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 0, 0, @DesktopWidth, @DesktopHeight )
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, @DesktopWidth/2-336, @DesktopHeight/2-256)
; Draw PNG complete
$Progress1 = GUICtrlCreateProgress(@DesktopWidth/2-203, @DesktopHeight/2+10, 400, 25)
#EndRegion ### END Koda GUI section ###
#Region ### Do install ###
$sectionnames = IniReadSectionNames ( @ScriptDir & "\config.ini" )
$itemcount = _ArrayMax($sectionnames)
For $i = 1 to $itemcount Step 1
$runpath = @ScriptDir & "\install\" & IniRead ( @ScriptDir & "\config.ini", "Item_" & $i, "install", "default" )
RunWait ($runpath )
GUICtrlSetData ( $Progress1, GUICtrlRead ($Progress1)+ 100/$itemcount)
Next
MsgBox(0,"", "Установка завершена!")
#EndRegion ### End Install ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
GDIPlus все рисует как надо, но когда над окном появляются какието другие окна или меседж боксы мы получаем то что видим на приатаченом скрине. Как избежать такой гадости?