corgano Posted June 12, 2009 Share Posted June 12, 2009 (edited) Been playing around with your code. Trying to make it: 1) show icon instead of box ; kind of done 2) make everything ecpt icon transparent 3) put program icons around main icon, show on mouse over here is a gui test. Someone might find it usefull CODE REMOVED (see last post) note, I have lots of it commented out. this was just a draft i finished at 12:30 AM, so please give me some slack. Edited June 13, 2009 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
pintas Posted June 12, 2009 Share Posted June 12, 2009 Looks nice but i got come includes missing... where can i find these? #include <foo.au3> #include <GUIOnlyControlsVisible.au3> Link to comment Share on other sites More sharing options...
corgano Posted June 13, 2009 Share Posted June 13, 2009 (edited) Looks nice but i got come includes missing... where can i find these?#include <foo.au3>#include <GUIOnlyControlsVisible.au3>sorry just comment thoes out. I am gonna remove the script from that post and update this one with the new script. Now it has the middle icon as the first selected program. It looks kinda cool. Brace for updateUPDATEHere it is. First file gives center icon. Icon will give glitches if a link or certin file types are chosen. The add button works, but not too well. Needs ALOT of patching, but you may find parts of it usefull.*CODE REMOVED* (update last post with stable version when avilable) Edited June 18, 2009 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
gooker Posted June 15, 2009 Share Posted June 15, 2009 like it,but have some bug. Link to comment Share on other sites More sharing options...
corgano Posted June 15, 2009 Share Posted June 15, 2009 like it,but have some bug.Only ment to be a GUI test.Someone can patch it up, I will try too.Eventually want to do away with the background when small. When big, give it the gray background.It has 9 slots so the method i am thinking of is haveing slot 5 (the middle) set first and then as you add programs it ill fill up slots 1 - 9 (skiping 5).any thoughts? 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
torels Posted June 15, 2009 Author Share Posted June 15, 2009 what if I want to add 10 links ? XD anyway good job Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
corgano Posted June 15, 2009 Share Posted June 15, 2009 what if I want to add 10 links ? XDanyway good job TyI would have to make it add another box, or even simpler, open itself. The idea of it is for projects, where you have the script and a few includes, or games (I have stronghold 1, 2, crusader, and Legends). If you had a game and a map editor you could put in 1 icon 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
gseller Posted June 15, 2009 Share Posted June 15, 2009 Very nice, a big drawback currently is that it doesn't work with opening folders/drives or shortcuts. I did see one bug involving an internal yes or no message but I can't make it happen again. Very Nice Link to comment Share on other sites More sharing options...
torels Posted June 15, 2009 Author Share Posted June 15, 2009 a yes or no message ?you mean a msgbox prompting you yes or no ?btwI am working on opening dirs/drives but I think that would require a custom FileOpenDialog thingyAFAIK you can't open directorys OR drives using FileOpenDialog if yes please tell me so! Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
gseller Posted June 16, 2009 Share Posted June 16, 2009 I apologize, I cannot remember how I set the alert, it was a yes or no msg. How about using FileSelectFolder for folders? Link to comment Share on other sites More sharing options...
torels Posted June 18, 2009 Author Share Posted June 18, 2009 I thought of that but an Issue came immediately: "How am I supposed to know wether the user is going to add a folder OR a file ?" And I thought: I could use a FileSelectFolder to select a folder and then use an eventual FileOpenDialog to select a file. But it gets VERY annoying Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
corgano Posted June 18, 2009 Share Posted June 18, 2009 (edited) I thought of thatbut an Issue came immediately: "How am I supposed to know wether the user is going to add a folder OR a file ?"And I thought:I could use a FileSelectFolder to select a folder and then use an eventual FileOpenDialog to select a file. But it gets VERY annoying I am exparamenting with click and draging files into the box. I will let you know when i come up with something.....What I need help with is getting the icon of the file or the program that opens the selected file. Made a help topic at http://www.autoitscript.com/forum/index.ph...mp;#entry697384 Edited June 18, 2009 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
dantay9 Posted June 18, 2009 Share Posted June 18, 2009 (edited) I think I found an error. I add a file normally (happened to be a .exe file) and close the program. Then I moved the file to another location. When I reopened the program and moved my mouse over the gui so it expanded, an error came up saying that the file cannot be located. You could perform a check at the beginning of the script to make sure that the file exists there before the gui starts. You could even go so far as to check if the file exists before you run the program that was clicked on to make sure that the file was there. If the file isn't there, you can just provide a simple error message explaining the situation. Just my two cents. You could also put the ini file in the application files directory so it isn't erased by system cleanup utilities like CCleaner. You should also create an ini file if the current ini doesn't exist because a missing ini file causes error in the rest of the script sometimes (such as IniReadSectionNames). Edited June 18, 2009 by dantay9 Link to comment Share on other sites More sharing options...
corgano Posted June 18, 2009 Share Posted June 18, 2009 Here is the beta of my gui. It uese a much simpler while loop and a lot more complicated icon system. $icon[number of icon][1 = icon ctrl, 2 = path to execute] expandcollapse popup#Include <Constants.au3> ;~ #Include <GDIPlus.au3> #Include <SendMessage.au3> #Include <StaticConstants.au3> #Include <WinAPI.au3> dim $Ext[1] = [0] $i = 2 while 1 $Key = RegEnumKey('HKCR', $i) if (@error) or (StringLeft($Key, 1) <> '.') then exitloop endif $Ext[0] += 1 redim $Ext[$Ext[0] + 1] $Ext[$Ext[0]] = $Key $i += 1 wend GUICreate('Test', 120, 140) $Reg = _GetRegDefIcon($Ext[1]) $Label = GUICtrlCreateLabel($Ext[1], 10, 16, 100, 20, 0x01) $Icon = GUICtrlCreateIcon('', 0, 36, 44, 48, 48) _SetIcon($Icon, $Reg[0], $Reg[1], 48, 48) $Button = GUICtrlCreateButton('Next', 25, 106, 70, 23) GUISetState() $i = 1 while 1 $Msg = GUIGetMsg() switch $Msg case -3 exit case $Button $i += 1 if $i > $Ext[0] then $i = 1 endif GUICtrlSetData($Label, $Ext[$i]) ;~ MsgBox(0,"",$Ext[$i]) $Reg = _GetRegDefIcon($Ext[$i]) _SetIcon($Icon, $Reg[0], $Reg[1], 48, 48) endswitch wend func _GetRegDefIcon($Path) const $DF_NAME = @SystemDir & '\shell32.dll' const $DF_INDEX = 0 local $filename, $name, $ext, $count, $curver, $defaulticon, $ret[2] = [$DF_NAME, $DF_INDEX] $filename = StringTrimLeft($Path, StringInStr($Path, '\', 0, -1)) $count = StringInStr($filename, '.', 0, -1) if $count > 0 then $count = StringLen($filename) - $count + 1 endif $name = StringStripWS(StringTrimRight($filename, $count), 3) $ext = StringStripWS(StringRight($filename, $count - 1), 8) if StringLen($ext) = 0 then return $ret endif $curver = StringStripWS(RegRead('HKCR\' & RegRead('HKCR\' & '.' & $ext, '') & '\CurVer', ''), 3) if (@error) or (StringLen($curver) = 0) then $defaulticon = _WinAPI_ExpandEnvironmentStrings(StringReplace(RegRead('HKCR\' & RegRead('HKCR\' & '.' & $ext, '') & '\DefaultIcon', ''), '''', '')) else $defaulticon = _WinAPI_ExpandEnvironmentStrings(StringReplace(RegRead('HKCR\' & $curver & '\DefaultIcon', ''), '''', '')) endif $count = StringInStr($defaulticon, ',', 0, -1) if $count > 0 then $count = StringLen($defaulticon) - $count $ret[0] = StringStripWS(StringTrimRight($defaulticon, $count + 1), 3) if $count > 0 then $ret[1] = StringStripWS(StringRight($defaulticon, $count), 8) endif else $ret[0] = StringStripWS(StringTrimRight($defaulticon, $count), 3) endif if StringLeft($ret[0], 1) = '%' then $count = DllCall('shell32.dll', 'int', 'ExtractIcon', 'int', 0, 'str', $Path, 'int', -1) if $count[0] = 0 then $ret[0] = $DF_NAME if StringLower($ext) = 'exe' then $ret[1] = 2 else $ret[1] = 0 endif else $ret[0] = StringStripWS($Path, 3) $ret[1] = 0 endif else if (StringLen($ret[0]) > 0) and (StringInStr($ret[0], '\', 0) = 0) then $ret[0] = @SystemDir & '\' & $ret[0] endif endif if not FileExists($ret[0]) then $ret[0] = $DF_NAME $ret[1] = $DF_INDEX endif ; if $ret[1] < 0 then ; $ret[1] = - $ret[1] ; else ; $ret[1] = - $ret[1] - 1 ; endif return $ret endfunc; _GetRegDefIcon func _SetIcon($controlID, $sIcon, $iIndex, $iWidth, $iHeight) const $STM_SETIMAGE = 0x0172 local $hWnd, $hIcon, $Style, $Error = false $hWnd = GUICtrlGetHandle($controlID) if $hWnd = 0 then return SetError(1, 0, 0) endif $hIcon = _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) if @error then return SetError(1, 0, 0) endif $Style = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) if @error then $Error = 1 else _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitOR($Style, Hex($SS_ICON))) if @error then $Error = 1 else _WinAPI_DeleteObject(_SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_ICON, 0)) _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_ICON, _WinAPI_CopyIcon($hIcon)) if @error then $Error = 1 endif endif endif _WinAPI_DeleteObject($hIcon) return SetError($Error, 0, not $Error) endfunc; _SetIcon func _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) local $hIcon, $tIcon = DllStructCreate('hwnd'), $tID = DllStructCreate('hwnd') local $ret $ret = DllCall('user32.dll', 'int', 'PrivateExtractIcons', 'str', $sIcon, 'int', $iIndex, 'int', $iWidth, 'int', $iHeight, 'ptr', DllStructGetPtr($tIcon), 'ptr', DllStructGetPtr($tID), 'int', 1, 'int', 0) if (@error) or ($ret[0] = 0)then return SetError(1, 0, 0) endif $hIcon = DllStructGetData($tIcon, 1) if ($hIcon = Ptr(0)) or (not IsPtr($hIcon)) then return SetError(1, 0, 0) endif return SetError(0, 0, $hIcon) endfunc; _WinAPI_PrivateExtractIcon enjoy 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
egymma Posted August 8, 2009 Share Posted August 8, 2009 Great work [center][/center]My Projects:-[list][*]Window Ender[*]Encryptor-Decryptor[/list] Link to comment Share on other sites More sharing options...
yehia Posted August 8, 2009 Share Posted August 8, 2009 this is just gr8 i like it >_ My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
BrettF Posted August 8, 2009 Share Posted August 8, 2009 Well This was cool until I tried to move it a few times and somehow opened 100million versions of the file... >_< WHY! It was so cool! Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
RomanK Posted August 8, 2009 Share Posted August 8, 2009 Man, this is awesome! It is a great concept and has much potencial. You can get far with this >_< [font="Courier New"]http://RomanK.hondadesigns.com[/font] 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