|
Thank you very much.
After posting this message I searched in code project and indeed got to your article "Enumerate Installed Devices Using Setup API[^]". I loved it very much very intresting.
I will read the second one now.
Regards
Y.R.
|
|
|
|
|
A. Riazi
|
|
|
|
|
hi guys,
I need a help.
How to set height of Edit Control?
Please let me know if you have any advices or solutions.
Thank you very much!
Best Regard,
KHLin.
|
|
|
|
|
You can set the height/width of the edit control using any of the following
mehtods.
BOOL MoveWindow(HWND hWnd,
int X,
int Y,
int nWidth,
int nHeight,
BOOL bRepaint
);
HWND CreateWindow(LPCTSTR lpClassName,
LPCTSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam
);
Cheers,
Vishal
|
|
|
|
|
I use function shellexecute (0, "open", "filename", "", "path", SW_SHOW) to execute a program and it runs ok. But I want to get the HWND (handle) of this executed file so that i can hide, minimze, or close it. Please help me how to code (in win32 api) to get the HWND. Thanks.
|
|
|
|
|
Hi,
You can get HWND for the application you are opening through "ShellExecute"
using following technique
Psedo code:
ShellExecute(GetDesktopWindow(), "open", "filename", "", "path", SW_SHOW)
EnumChildWindows(GetDesktopWindow(), CallBackChildWindows, lParam)
CallBackChildWindows(...)
{
int iRet;
//Get the class name of the window
iRet = GetClassName(hwnd,strClassName,..)
if(iRet!=0)
{
//You must be knowing the class name for the application, which you are
//opening through the SheeExecute. So match the class name here, once
//match the class name exit from this proc.
//arrStrClassNames would have all the class names
if(strClassName==arrStrClassNames[iIndex])
return false
else
return true
}
}
Still facing problems ?
Cheers,
Vishal
|
|
|
|
|
What about Creating Process using CreateProcess Api,Which give Ultimate Control of Process creating Application to control the new born process.
have a look at this article:-
http://www.codeproject.com/system/newbiespawn.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Also look at ShellExecuteEx instead of ShellExecute
|
|
|
|
|
I have this C++ course and I have creatd a linked list with methods to insert and remove. The program works fine for me but for my instructor it crashes, for him, most likely since he uses his version of main. I can't trobleshoot my version, that easy, since it works. What I suspect is that my remove method wants an actual parameter of a pointer that points to a real address,(not null) and perhaps my instructors main is only sending a pointer. Is it possible to send a pointer, (of a user defined data type UDT) to a method and have that method set what this calling parameter will point to? I hope this makes sense. I have been spending many hours trying to learn all the ins and outs of pointers.
Thanks
If only I had more time!
|
|
|
|
|
Have you tried passing bad values to your methods. Like trying to remove the same element more than one time? If you remove all emements in your main does it crash?
bitsNbites wrote:
I hope this makes sense.
Not fully.
John
|
|
|
|
|
Did you compile and run under Debug mode? And your instructor built and run in Release mode?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I am trying with a program that will create an ActiveDesktop. I want to manipulate the buttons on ActiveDesktop which is intented to manipulate the state of the ActiveDesktop as IS_NORMAL, IS_FULLSCREEN, IS_SPLIT. Is there any option for doing it programically?
I am using IActiveDesktop to manipulate the ActiveDesktop.
Waiting your responses
Vinod
|
|
|
|
|
I have tried using RegisterHotkey for Windows XP to disable Alt-Tab and it worked properly. But when i tried using the same code for Windows 98, the Alt-Tab is still working. How do you do this in Windows 98? Thank You.
|
|
|
|
|
|
Global keyboard hooks would do the trick for you.
Cheers,
Vishal
|
|
|
|
|
messages like ON_EN_SETFOCUS for a CEdit Control is typically sent through its parent,ryt?
This is the situation of CControlBar->Intermediate CWnd->CEdit..
CControlBar is docked on a CMainFrame... CEdit's parent is an intermediate CWnd..
I want SetFocus notifications and ENTER key presses to be handled by CControlBar or on the CMaiNFrame.. is there anyway i can do these?
regards,
Maverick
|
|
|
|
|
I am unable to activate the CButton control that I put on a CDialogBar.
I remember reading somewhere that on a Dialog bar the CButton is disabled.
Can i enable it ?
Thanx in advance
laiju
|
|
|
|
|
Hello. I have the same problem also.. Although I haven't tried it yet, this is the info i got on a website.. hope this helps...
INFO: CDialogBar Button Enabled When Command Handler Present
View products that this article applies to.
Article ID : 98198
Last Review : December 11, 2003
Revision : 1.0
This article was previously published under Q98198
A button in a CDialogBar object is disabled automatically if the command routing does not contain a command handler function for the button.
To enable a button in a CDialogBar object, the command routing must include a command handler for the button. A button command handler can be an ON_BN_CLICKED(), ON_COMMAND(), or ON_COMMAND_UI() message handler and it must appear in the message map of an object in the command routing. If the parent of the CDialogBar object is a CFrameWnd object, then the command is handled by the active child window or view, by the document attached to the view, by the frame window, and by the application (CWinApp object).
NOTE: Because the CDialogBar object is not included in the routing scheme, the ON_BN_CLICKED() or ON_COMMAND() handler must be placed in one of the objects mentioned above that is in the routing scheme and not in the CDialogBar class.
For more information on command routing, see the "Command Routing" section in Chapter 3 of the "Class Library Reference" manual. In Visual C++ 32-bit Edition, version 4.0, see both the "Command Routing" topic of the "Programming with MFC: Overview" in the Books Online and the MFC Technical Note 31, Control Bars.
--------------------------------------------------------------------------------
http://www.kbalertz.com/kb_98198.aspx[^]
|
|
|
|
|
How can i disable the horizontal scroll bar at run time.
laiju
|
|
|
|
|
I havent got any useful hits from google, does anyone here know how to obtain the string representation of an HKEY? Note that HKEY can be any key and not just the top level keys. Thanks!
|
|
|
|
|
I am using MFC and want to know the application folder (typically, but not necessarily "C:\Program Files\MyProgram") so I can read and save an initialization file for the program. A program that uses the main() function, arg[0] is usually the program's command line with subsequent arg[n] being the additional command line parameters. CWinApp does not appear to provide this information and I have looked through the help files and the CodeProject message board without success.
Any help would be greatly appreciated.
TIA
Ron
|
|
|
|
|
Well I dont use MFC I only know the API way so:
you can get it like this:
[code]
char path[_MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), path, _MAX_PATH );
[/code]
Path holds the full address of your exe like "C:\Program Files\Program\test.exe"
just delete text.exe from it and its done...
Well... I am a beginner ...
|
|
|
|
|
|
Check if this code is of any help :-
CString szCurrentDirectory;<br />
{<br />
CString csPath;<br />
<br />
<br />
::GetModuleFileName(NULL,csPath.GetBuffer(MAX_PATH),MAX_PATH);<br />
<br />
csPath.ReleaseBuffer();<br />
<br />
szCurrentDirectory=csPath.Left(csPath.ReverseFind('\\'));<br />
<br />
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks to all who responded. Problem solved!
Ron
|
|
|
|