1 // $Id: switcher.cpp,v 1.3 2002/06/29 16:00:28 nedko Exp $
4 // Copyright (C) 2000,2001,2002 Nedko Arnaudov <nedko@users.sourceforge.net>
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "DesktopSwitcher.h"
29 BEGIN_OBJECT_MAP(ObjectMap
)
32 int CALLBACK
WinMain(HINSTANCE hInstance
,
33 HINSTANCE hPrevInstance
,
37 _Module
.Init(ObjectMap
,hInstance
);
38 int cThreads
; // number of desktops
40 // parse command line to determine number of desktops
44 lpCmdLine
= GetCommandLineA();
49 while (*lpCmdLine
!= ' ' && *lpCmdLine
!= 0)
53 // Find the parameters
55 while (*lpCmdLine
!= 0)
60 if (*lpCmdLine
== ' ')
67 // Do we have a dash? If not, just exit the loop
69 if (*lpCmdLine
++ != '-')
80 while (*lpCmdLine
== ' ')
83 if (*lpCmdLine
== 0 || *lpCmdLine
== '-')
87 while (*lpCmdLine
>= '0' && *lpCmdLine
<= '9')
88 cThreads
= cThreads
* 10 + (*lpCmdLine
++ - 0x30);
95 g_Image
.LoadPNGImage("C:\\topka.png");
97 CDesktopSwitcher TheSwitcher
;
98 HRESULT hr
= TheSwitcher
.Go(cThreads
);
102 sprintf(Buffer
,"Failed to initialize. Error is 0x%X",hr
);
103 ::MessageBox(NULL
,Buffer
,"Desktop Switcher",MB_OK
|MB_ICONSTOP
);