Jump to content

Multiple Desktops - V 1.5.1


Achilles
 Share

Recommended Posts

New Version

Changes

  • The toolbar bug mentioned above should be working
  • The bug about deleting desktops should be fixed
Pending Problems
  • PNG pictures are not supported by the toolbar
  • Toolbar position can sometimes not be accurate when the toolbar is recreated
Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Replies 172
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

@Mr. Zero: Yes, that is what I was talking about. However, in a brief look at the link I don't think I have the time or capability of doing that right now. Has anyone made one of these already?

Remove $WM_USER to make it work. Guess only old AutoIt needed it declared?

CODE
#include <GUIConstants.au3>

Opt("WinTitleMatchMode", 4)

Opt("WinSearchChildren", 1)

Global Const $WM_SETFONT = 0x0030

Global Const $WM_USER = 0x0400

Global Const $HKM_SETHOTKEY = $WM_USER+1

Global Const $HKM_GETHOTKEY = $WM_USER+2

Global Const $HKM_SETRULES = $WM_USER+3

Global Const $HOTKEYF_SHIFT = 0x01

Global Const $HOTKEYF_CONTROL= 0x02

Global Const $HOTKEYF_ALT = 0x04

Global $hFont = 0

$gui_Main = GuiCreate('Get Hotkey', 300, 200)

$bt = GuiCtrlCreateButton('See Value', 10, 40, 100, 30);

GUICtrlSetState(-1, $GUI_DEFBUTTON)

$a_HotKey = DllCall('user32', 'hwnd', 'CreateWindowEx', _

'long', 0, _

'str', 'msctls_hotkey32', _

'str', '', _

'int', BitOr($WS_CHILD, $WS_VISIBLE, $WS_TABSTOP), _

'int', 10, _

'int', 10, _

'int', 200, _

'int', 20, _

'hwnd', $gui_Main, _

'long', 0, _

'hwnd', 0, _

'ptr', 0)

; SetFont(hwnd, size, weight, atrribute, font)

; Attributes: 2 = italic, 4 = underline, 8 = strikeout -> like GUICtrlSetFont()

; Can be combined: italic + underline = 6

SetFont($a_HotKey[0], 8, 400, 0, 'MS SANS SERIF')

SetFocus($a_HotKey[0]); Sets the focus to the hotkey control

GuiSetState()

While 1

$gm = GuiGetMsg()

If $gm = $GUI_EVENT_CLOSE Then ExitLoop

If $gm = $bt Then

$i_HotKey = SendMessage($a_HotKey[0], $HKM_GETHOTKEY, 0, 0)

$n_Flag = BitShift($i_HotKey, 8)

$sz_Flag = ""

If BitAnd($n_Flag, $HOTKEYF_SHIFT) Then $sz_Flag = "SHIFT + "

If BitAnd($n_Flag, $HOTKEYF_CONTROL) Then $sz_Flag = $sz_Flag & " CTRL + "

If BitAnd($n_Flag, $HOTKEYF_ALT) Then $sz_Flag = $sz_Flag & " ALT + "

InputBox('HotKey control return:', $i_HotKey & @LF & 'Chr(' & $i_HotKey & ') = ', $sz_Flag & Chr($i_HotKey))

EndIf

WEnd

DeleteFont($hFont); Deletes created font before leaving

Exit

Func SendMessage($hWnd, $Msg, $wParam = 0, $lParam = 0)

$a_Ret = DllCall('user32.dll', 'int', 'SendMessage', _

'hwnd', $hWnd, _

'int', $Msg, _

'int', $wParam, _

'int', $lParam)

Return $a_Ret[0]

EndFunc

; Set/create the font

Func SetFont($hWnd, $nSize, $nWeight, $nAtrribute, $szFont)

If $hFont = 0 Then

$hDc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hWnd)

$nPixel = DllCall("gdi32.dll", "int", "GetDeviceCaps", "hwnd", $hDc[0], "int", 90)

$nHeight = DllCall("kernel32.dll", "int", "MulDiv", "int", $nSize, "int", $nPixel[0], "int", 72)

$hFont = DllCall('gdi32.dll', 'hwnd', 'CreateFont', _

'int', -$nHeight[0], _

'int', 0, _

'int', 0, _

'int', 0, _

'int', $nWeight, _

'int', BitAnd($nAtrribute, 2), _

'int', BitAnd($nAtrribute, 4), _

'int', BitAnd($nAtrribute, 8), _

'int', 1, _

'int', 0, _

'int', 0, _

'int', 0, _

'int', 0, _

'str', $szFont)

EndIf

; Other possibility to select a font to the control:

;

; $hFont = DllCall('gdi32.dll', 'hwnd', 'GetStockObject', 'int', 11); Get "DEFAULT_GUI_FONT"

;

; -> font numbers can be :

; OEM_FIXED_FONT 10

; ANSI_FIXED_FONT 11

; ANSI_VAR_FONT 12

; SYSTEM_FONT 13

; DEVICE_DEFAULT_FONT 14

; DEFAULT_PALETTE 15

; SYSTEM_FIXED_FONT 16

; DEFAULT_GUI_FONT 17

;

; ! DeleteFont($hFont) before 'Exit' has to be commented out !

SendMessage($hWnd, $WM_SETFONT, $hFont[0], 1)

EndFunc

; Delete the font

Func DeleteFont($hFont)

DllCall('user32.dll', 'int', 'DeleteObject', 'hwnd', $hFont)

EndFunc

; Set focus to control window

Func SetFocus($hWnd)

DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $hWnd)

EndFunc

A simple forum search :)
Link to comment
Share on other sites

Real quick, ya the desktop link is correct now.

Have to also say awesome job on the custom made GUI, looks great!!

Thanks, I'm thinking of making it so that the GUI matches the toolbar (and as soon as you change the combo box color it changes all the GUI) but that would take a lot of work. And personally I think the green and yellow and not that great. Blue and red are pretty good though...

YAY!!!! I found the problem to those two stupid buttons, I'll be updating in a second!

I had the label above overlapping most of the buttons... :) Thanks to the AutoIt window thing for letting me see that one and smstroble for suggesting the possible error!

New Version

Only changed the functionality of those two buttons that weren't working.

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

1. Ok, here is a nice easy bug to fix :-) from the tray menu if you use the open menu you cannot choose a desktop that you created while the program was running (ie you have to restart Muti desk for it to work)

2. And this one is odd when i use a desktop other than my main one i cant put icons on the desktop, or right click on it to get the desktop menu or anything, though double clicking it seems to open the start menu. If i use Show Desktop, my icons appear and everything behaves normally though. This happens even if i dont use transition effects.

EDIT: Ok 3 more, 3. Multiple desktop does not seem to save icon positions for my alternate desktops. (fix to bug 2 fixed this)

4. if i switch to another desktop, use Show Desktop so that my icons and such appear and switch back my icons positions are not restored on my main desktop. (fix to bug 2 fixed this too)

5. I can't easily recreate this but flipping back forth between desktops will sometimes produce the following error,

AutoIt Error

Line -1:

Error: Array Variable has incorrect number of subscripts or subscript dimension range exceeded.

EDIT2: somehow that last problem #5 has caused bug #2 on my main desktop now.

EDIT3: update on bug #2 if i bring up any window the desktop disappears but if i close multiple desktops the desktop comes back and does not dissapear again. So i suspect that it is a window or graphic of somekind that is not being destroyed and probably has the popup or some similar attribute where you cannot minimize it.

Edited by smstroble

MUHAHAHAHAHA

Link to comment
Share on other sites

I have solved bug#2!!! The reason the desktop icons and such were being hidden for all BUT the main desktop is because multiple desktops was hideing the Program Manager window which is the desktop, i added that to my exclude list and now it works fine.

MUHAHAHAHAHA

Link to comment
Share on other sites

1. Ok, here is a nice easy bug to fix :-) from the tray menu if you use the open menu you cannot choose a desktop that you created while the program was running (ie you have to restart Muti desk for it to work)

EDIT: Ok 3 more, 3. Multiple desktop does not seem to save icon positions for my alternate desktops.

4. if i switch to another desktop, use Show Desktop so that my icons and such appear and switch back my icons positions are not restored on my main desktop.

5. I can't easily recreate this but flipping back forth between desktops will sometimes produce the following error,

AutoIt Error

Line -1:

Error: Array Variable has incorrect number of subscripts or subscript dimension range exceeded.

1. Ok, I'll fix that!

3. I do not know why that would be happening, I run 7 desktops where 5 of them have specific icon positions and they all work.

4. That's very interesting! At least now I know why sometimes all my icon positions would get lost. However I have absolutely what could be causing this... but I'll look in my code and see if there's anything that might be getting messed up by that.

5. I couldn't get that error. I was switching between all my desktops in every way possible... Hmm, let me know if you find out any more details on this.

Thanks a lot for testing this program so much, it's helping a lot!

Edit: I'll add something in to stop the user from hiding stuff like the program manager. Is there anything else that should be in that check list?

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

New Version

Changes

  • Tray now updates is now functional after adding a desktop
  • Program Manager can not be added to the exclude list
Pending Problems
  • PNG pictures are not supported by the toolbar
  • Toolbar position can sometimes not be accurate when the toolbar is recreated
  • A few bugs with the installer
Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 2 weeks later...

New Version

This update only concerns the installer, which is why the Multiple Desktops.exe is still version 1.2.2

Changes

  • Add _Singleton() to the installer
  • The FileSelectFolder() no longer is limited to @ProgramFilesDir, but includes all of the @HomeDrive
  • Fixes another bug with reading the install location
I'm planning on working on the actual program a little later today. There are a few things I have been wanting to do. Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

I love what you did with the installer, haha. Maybe you should use #notrayicon or Opt("TrayAutoPause", 0).

I can't get it to work though (I have Windows 2000). I see a blue square in the middle of the screen and when I open the settings window, the only buttons that work are the ones on the left side. Nothing happens when I click on 'Add desktop', 'Delete' or 'Browse' for example...

Link to comment
Share on other sites

:) I forgot about the tray icon! I'll take it out, thanks for noticing.

I don't really know how Windows 2000 works. The little blue box your seeing is the toolbar when you only have desktop. However, the toolbar should have your desktop background in it. Where does Win2000 store the desktop background picture?

I can only assume that of your problems are to do with Windows 2000 also... This works fine on my XP and I just tried it on Vista and it worked pretty well.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

New Version - 2.3.0

Changes

  • Changes "Mutiple Desktops" to "Multiple Desktops" in the install image
  • Added support for .png pictures for the toolbar
  • All pictures are now copied to @AppDataDir & '\Desktops\Pictures"
  • Added Multiple Desktops to the Start Menu
  • Fixed a few bugs with the uninstaller
  • Added #NoTrayIcon to the installer
Pending Tasks
  • Add customizable hotkeys
  • Add #NoTrayIcon to the uninstaller
  • Fix the bug with the toolbar's position when it gets recreated
Let me know if I missed any suggestions you had in regards to this program! Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 1 month later...

=== Updates coming soon ===

  • Customizable Hotkeys (Mostly done)
  • Blue skin for the options GUI instead of Red
  • Updated Source Code to the newest version (including functionality with the newest Beta)
  • Find a way to detect the if the user used Windows to change the Wallpaper and update accordingly
  • Some more unique animations types
  • Add #NoTrayIcon to the uninstaller
  • Fix the bug with the toolbar's position when it gets recreated
  • Add a tray tip the first time the program is run so the user can understand how to use it
Please let me know if you want any other suggestions so I can think them out in advance. I have a four day holiday coming soon so I plan to make all updates to this program throughout that time.

EDIT: Things that are crossed out are just for my reference

EDIT2: Changes "within in the next week" to "soon" <_<

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 3 months later...

Hey Piano_Man, great software...I love it...the only thing I dont like...is the part where I cant move my files from 1 desktop to another...like i want my extra desktop JUST for autoit...so...i want to transfer all my autoit files but I cant...? Is there a way around this?

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...