Jump to content

---


playlet
 Share

Recommended Posts

  • Replies 338
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

playlet,

You have a nice job, but if you do not mind, I'll give you some tips:

  • Of course, _GetRegDefIcon() is a good function, but I have wrote a replacement for this. Look at _WinAPI_AssocQueryString() from the WinAPIEx.au3.

    #Include <WinAPIEx.au3>
    
    Global $Ext = '.au3'
    
    ConsoleWrite('(' & $Ext & ')' & @CR)
    ConsoleWrite('--------------------' & @CR)
    ConsoleWrite('Type: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_FRIENDLYDOCNAME) & @CR)
    ConsoleWrite('Command: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_COMMAND) & @CR)
    ConsoleWrite('Executable: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_EXECUTABLE) & @CR)
    ConsoleWrite('Icon: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_DEFAULTICON) & @CR)
  • I advise you to use _WinAPI_DrawIconEx() for drawing icons, it looks much nicer.

    #Include <GDIPlus.au3>
    #Include <Icons.au3>
    #Include <WinAPIEx.au3>
    #Include <WindowsConstants.au3>
    
    _GDIPlus_Startup ()
    
    $hImage = _GDIPlus_ImageLoadFromFile ('Playlet_Skin.png')
    $Width = _GDIPlus_ImageGetWidth($hImage)
    $Height = _GDIPlus_ImageGetHeight($hImage)
    $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _GDIPlus_ImageDispose($hImage)
    
    $hForm = GUICreate('', $Width, $Height, -1, -1, $WS_POPUPWINDOW, $WS_EX_LAYERED)
    
    $hDC = _WinAPI_GetDC($hForm)
    $hMemDC = _WinAPI_CreateCompatibleDC($hDC)
    $hSv = _WinAPI_SelectObject($hMemDC, $hBitmap)
    $hIcon = _WinAPI_ShellExtractIcons(@SystemDir & '\shell32.dll', 130, 32, 32)
    _WinAPI_DrawIconEx($hMemDC, 118, 12, $hIcon, 32, 32)
    _WinAPI_DestroyIcon($hIcon)
    $hIcon = _WinAPI_ShellExtractIcons(@SystemDir & '\shell32.dll', 160, 32, 32)
    _WinAPI_DrawIconEx($hMemDC, 118, 70, $hIcon, 32, 32)
    _WinAPI_DestroyIcon($hIcon)
    $hIcon = _WinAPI_ShellExtractIcons(@SystemDir & '\shell32.dll', 31, 32, 32)
    _WinAPI_DrawIconEx($hMemDC, 118, 124, $hIcon, 32, 32)
    _WinAPI_DestroyIcon($hIcon)
    $hIcon = _WinAPI_ShellExtractIcons(@SystemDir & '\shell32.dll', 130, 48, 48)
    _WinAPI_DrawIconEx($hMemDC, 175, 180, $hIcon, 48, 48)
    _WinAPI_DestroyIcon($hIcon)
    $tSize = DllStructCreate($tagSIZE)
    DllStructSetData($tSize, 1, $Width)
    DllStructSetData($tSize, 2, $Height)
    $pSize = DllStructGetPtr($tSize)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, 'Alpha', 255)
    DllStructSetData($tBlend, 'Format', 1)
    _WinAPI_UpdateLayeredWindow($hForm, $hDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
    _WinAPI_ReleaseDC($hForm, $hDC)
    _WinAPI_SelectObject($hMemDC, $hSv)
    _WinAPI_DeleteDC($hMemDC)
    
    GUISetState()
    
    Do
    Until GUIGetMsg() = -3
    
    _GDIPlus_ShutDown ()
  • IMHO there is no reason to create PL_Includes.au3 file and put to this file native AutoIt functions. They come with AutoIt.
Edited by Yashied
Link to comment
Share on other sites

I did this because the goal of this launcher is to reduce compiled size as much as you can, even with all those skins. AutoIt includes include way more functions which then increase size of compiled exe.

Yes, but ~100KB above is not serious. But if the UDF will be updated, you have to re-write PL_Includes.au3, however, it's of course your case. Edited by Yashied
Link to comment
Share on other sites

Hi

Did you compile my original version or did you make some changes and then compile? Try deleting "Config.ini", I've made some changes to ini file.

I wish people gave me more feedback about this launcher. Does it work on all Windows versions?

Hi,

I don't make any changes, used to original version, download, compiled and tryed, but 4.0.5.2 is same again.

Skin and buttons is not shown, I look in the config.ini, see any changes, but everythings is normal:S

(I wish people gave me more feedback about this launcher. Does it work on all Windows versions?)

Yes I'm used on Xp Vista and win7, worked.

Edited by MHOrhan
Link to comment
Share on other sites

I tried on windows xp and seven. Both x86, Both worked great. I actually hate vista more than I love this launcher. So, I won't set up vista just to try this. But I can't see why this shouldn't work.

[Not using this account any more. Using "iShafayet" instead]

Link to comment
Share on other sites

Link to comment
Share on other sites

Link to comment
Share on other sites

Ok, I will change @SW_SHOW to @SW_SHOWNOACTIVATE in my next update. Is there some way to avoid losing focus from active window when you click on the launcher?

Wraithdu solved this problem in this post

I can't say it is easy though :mellow:

Edited by picea892
Link to comment
Share on other sites

If you decide to use the skins (WS_EX_LAYERED), I recommend you forget about any controls. Use the main image as a base and just draw on top the required elements (icons). Look at my Calculator, there were no controls, only GUI that is updated by using _WinAPI_UpdateLayeredWindow() function. The mouse position is controlled in a loop with GUIGetCursorInfo(). What came of it, you can see themselves. That is what I tried to show you. Of course, you will have to rewrite your code, but it's worth it. Anyways, the solution for you.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...