|
You can check return value with return value of GetDesktopWindow.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I tried this:
if (GetForegroundWindow()->m_hWnd == GetDesktopWindow()->m_hWnd)
But it doesn't work
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
|
|
|
|
|
How can I set the focus to the next open window after I minimize some other window ?
For example:
I have the following apps open: IE, Word, Notepad
When I minimize - Notepad is going to the task bar,
At this point I lose the focus and the other open windows cannot be minimized
(My program do minimize the current window in focus when I click something)
This is what I tried:
GetForegroundWindow()->ShowWindow(SW_SHOWMINIMIZED);
Sleep(1000); // Let it minimize ?
::GetWindow(GetForegroundWindow()->m_hWnd, GW_HWNDNEXT);
Any ideas ?
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
|
|
|
|
|
OK, I partially managed to do it with the following code:
GetForegroundWindow()->ShowWindow(SW_SHOWMINIMIZED);
CWnd* pCurrentWindow;
POINT pt;
GetCursorPos(&pt);
pCurrentWindow = WindowFromPoint(pt);
pCurrentWindow->SetForegroundWindow();
The problem is that it will only get the focus of windows behind the cursor (mouse)
Any idea how to get the next window regardless to the cursor location ?
Best Regards - Yovav Gad
CEO and founder of MicroMighty, Inc.
modified on Saturday, April 25, 2009 6:11 AM
|
|
|
|
|
Development Environment:
Microsoft Visual Studio 2008, Version 9.0.30729.1
Microsoft .NET Framework Version 3.5 SP1
Microsoft Windows Server 2003 Enterprise Editions, Service Pack 2
Intel® Pentium® D CPU, 2.80GHz, 1 GB/4 GB of RAM
mssoap1.dll
Problem:
I have used mssaop1.dll interfaces to invoke the web services method.
I have used following interfaces in my code
ISoapSerializerPtr
ISoapReaderPtr
ISoapConnectorPtr
When I try to compile with mssoap30.dll it fails. My objective is to compilethis program with any version of mssaop.dll. Is there any other work around to resolve above issue with minimal code change?
Thanks,
Ramesh Kr Singh
Ramesh Kumar Singh
Software Engineer
Ness Technologies
India
|
|
|
|
|
Hi all,
i have created a service like this.its created successfully,but not started.
#define SVCNAME TEXT("Test_Service_Name")
SC_HANDLE schSCManager;
SC_HANDLE schService;
TCHAR szPath[MAX_PATH];
if( !GetModuleFileName( NULL, szPath, MAX_PATH ) )
{
printf("Cannot install service (%d)\n", GetLastError());
return;
}
schSCManager = OpenSCManager(
NULL,
NULL,
SC_MANAGER_ALL_ACCESS);
if (NULL == schSCManager)
{
printf("OpenSCManager failed (%d)\n", GetLastError());
return;
}
schService = CreateService(
schSCManager,
SVCNAME,
SVCNAME,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
szPath,
NULL,
NULL,
NULL,
NULL,
NULL);
if (schService == NULL)
{
printf("CreateService failed (%d)\n", GetLastError());
CloseServiceHandle(schSCManager);
return;
}
else printf("Service installed successfully\n");
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);
please tell me how can i start a service.
or tell me how can i call another application from created service.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
See StartService function.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i m also chk this but still service not started.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What was the return value of StartService?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
its return 0. get error from GetLastError();
"The service did not respond to the start or control request in a timely fashion."
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Did you use of any firewall or anti virus and whats your OS? this code doesnt have problem I saw full code on the MSDN?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi friends ..
In my project i need to send an email to our customer using vc++.Please anybody send me an article or sample programme to send an email in vc++.Please Help me
Thanks in Advance
Anitha
|
|
|
|
|
Use CodeProject article search engine,I'm sure you'll find something useful.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Hello Friends..
Good Morninig..In my project i need to write some content into pdf file using vc++.Please any body help me to send an article or sample programme for create pdf file using vc++. Pls help me.
Thanks and regrda
Anitha
|
|
|
|
|
Too lazy for using CP's article search engine [^] ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In my humble oppinion the easiest way to do that would be to download and install a PDF writer printer driver (e.g: CutePDF) and then print whatever you need to be put in a PDF with it. Of course if you don't know anything about printing then it's probably not that simple.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
|
All you need to do is convert your drawing commands to PDF Postscript and write this to a file. Be prepared to commit yourself to this as it takes a few weeks to get started drawing primitives and a couple more for text output. Again a few more for graphics. All in all, a rock solid GDI+ to PDF Postscript creator can take several months to complete.
PDF Reference 1.7, Sixth Edition[^]
(I recommend downloading this reference if your going to view it as it tends to download resources as they are needed if you view it online in the IE window) 1000+ pages
|
|
|
|
|
Hi,
I have build my project in Release-Unicode with debug information on .
Still my project is not getting attached to a process
|
|
|
|
|
When you say, "my project is not getting attached to a process",...what does that mean exactly? Did your project actually compile correctly (without errors)? Are you executing the binary application? Or what?
|
|
|
|
|
Hai!
From last two days I have been searching for code that displays an image from BYTE array, i posted this question multiple times, i even got responses but i was either not able to understand them or not able to use them, The reason is i am new to the IMAGES concept.
Finally i got i solution I was able to display image from byte array by importing CPictureCtrl class from :
http://www.codeproject.com/KB/graphics/CPictureControl.aspx
Finally i am having two problems :
Prob1: I first imported the CPictureCtrl Classes (.h &.cpp) into my Visual Studio 2005 Dialog based application and tried to display .bmp, .jpg, .jp2 images, by using code as explained in above URL,
.bmp and .jpg got displayed but not .jp2, Can you please explain me how to convert .jp2 image to either .jpg or .bmp or how to display .jp2 image using CPictureCtrl Class.
Prob2:My actual requirement is to do a dialog based application in which i have image display from byte array for a pocket PC Device(2003) in eMbedded VC++, The CPictureCtrl class uses GdiPlus.lib, i dowloaded GdiPlus.lib from net and pasted in
C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Lib\Armv4
where other libraries exist, and included the name "GdiPlus.lib" in MyProject>Properties>Link>AdditionalLibraries>GdiPlus.lib (both for debug and release) still i get error message :
fatal error C1083: Cannot open include file: 'gdiplus.h': No such file or directory
Can u please suggest me the correct version of GdiPlus.lib that is supported in eVC++
Thanks!
|
|
|
|
|
// CAbstractList derived form CObList
class CAbstractList :
public CObList
{
public:
CAbstractList(int nBlockSize = 10);
virtual ~CAbstractList();
};
CAbstractList::CAbstractList(int nBlockSize)
:CObList (nBlockSize)
{
}
CAbstractList::~CAbstractList()
{
}
//======================================
typedef CTypedPtrList<CAbstractList, CGraphBaseObj*> CMyObjectList ;
//If the Comments are removed it gives warning
class COhioObjectList /*:public CTOhioObjectList*/
{
public:
COhioObjectList()/* : CTOhioObjectList()*/{}
~COhioObjectList();
};
//======================================
1> D:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxtempl.h(1887) : while compiling class template member function '_CTypedPtrList<BASE_CLASS,TYPE>::_CTypedPtrList(INT_PTR)'
1> with
1> [
1> BASE_CLASS=CAbstractList,
1> TYPE=CGraphBaseObj *
1> ]
1> D:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxtempl.h(1961) : see reference to class template instantiation '_CTypedPtrList<BASE_CLASS,TYPE>' being compiled
1> with
1> [
1> BASE_CLASS=CAbstractList,
1> TYPE=CGraphBaseObj *
1> ]
1 ohoblist.h(35) : see reference to class template instantiation 'CTypedPtrList<BASE_CLASS,TYPE>' being compiled
1> with
1> [
1> BASE_CLASS=CAbstractList,
1> TYPE=CGraphBaseObj *
1> ]
1>D:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxtempl.h(1887) : warning C4244: 'argument' : conversion from 'INT_PTR' to 'int', possible loss of data
How to rectify this warning
VIBIN
"Fool's run away,where angle's fear to tread"
<div class="ForumMod">modified on Saturday, April 25, 2009 1:48 AM</div>
|
|
|
|
|
change the CAbstractList Ctor's arguemt form int to INT_PTR
CAbstractList::CAbstractList(<code>INT_PTR</code> nBlockSize)
:CObList (nBlockSize)
{
}
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Hi,
Pls let me know how can i execute Dos command in ShellExecute...the command is..
msiexec /i c:\Test\Test.msi ALLUSERS=1
Pls help me out....
|
|
|
|