|
Have you thought about getting into the address space of the process that creates the window(s) and subclassing the particular window in order to capture the relevant messages?
|
|
|
|
|
I had looked into this and it doesnt seem to hard to do providing I learn enough about the win32 API. However the part which seems to vary between applications is capturing the relevant messages. Ive used winspector to look at messages being sent back & forth between windows and there does appear to be any pattern to what happens when something under the cursor changes due to a 'mouse over'. I noticed the startbar (dv3controlhost , syslistview32) calls wm_ncpaint followed by wm_erasebackground when I move between items and the mouse overs activate but this doesnt seem consistance with other applications ive looked at like Adobe Audition. But ive notice Adobde Audition uses alot of custom classes in its contruction......
|
|
|
|
|
Hey everybody!
I am looking for a way to get a log-in notification from a service (I found stuff about winlogon notification package, but it doesn't work nowadays... The registry keys just doesn't exist anymore).
Can anyone give a little hint please?
thanks!
|
|
|
|
|
|
Thanks!
does "SERVICE_CONTROL_SESSIONCHANGE" works also in XP ???
|
|
|
|
|
Green Fuze wrote: does "SERVICE_CONTROL_SESSIONCHANGE" works also in XP ???
Yes.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello.
Can someone explain me how to create a C program using Visual Studio 2005?
(I've been trying lots of ways, e.g. creating c++ files, and changing
extension to a c file, but I was getting errors).
Thanks!
|
|
|
|
|
Write your program in VC++ seeing as it's an extension to the C language and just write your C code. You can ignore the C++ additions such as object-orientation etc
(or go with Mike's suggestion.)
[Edit]
If you're looking for a good C compiler, I'd recommend Pelles C. It's free, too.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
modified on Sunday, October 19, 2008 7:15 AM
|
|
|
|
|
New Visual Studio 2005 projects default to 'compile code as C++'. To change this, go to the project's Property Pages dialog and click the C/C++ folder, Advanced, and change Compile As to 'Compile Code As C (/TC)'.
"Multithreading is just one damn thing after, before, or simultaneous with another." - Andrei Alexandrescu
|
|
|
|
|
My project use CDatagrid to show the content of database.
and so each column not the same size, some column the content is long and some it is short so I want to resize each column to show properly content.
How can I do?
|
|
|
|
|
How to save a process's state and resume it later?

|
|
|
|
|
There's no default way to do that (as far as I know). You'll have to handle that yourself...
|
|
|
|
|
I'm trying to verify that a path exists by using either PathFileExists() or GetFileAttributes(), but when a network path like \\SWAP01\slave02\mydirectory doesn't exist because the system isn't on, both functions hang.
In fact, they hang pretty seriously, so much so that I can't kill the process from the debugger OR the task manager. My only option appears to be to log off from the system and log back in.
Any thoughts on how I might better deal with this hang?
|
|
|
|
|
TragicComic wrote: Any thoughts on how I might better deal with this hang?
Have you tried _access() ? It's a wrapper around GetFileAttributes() so it may not be any better.
If you are using MFC, check out CFile::GetStatus() .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I've a PE file and I'm going to set the file alignment to '1' in it. It's initially set to '512'. When I change it to '1', an error message says "This is an invalid PE file ...".
Any suggestion PLS?
Thank you masters!
|
|
|
|
|
Maybe that's an invalid file alignment value?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The file section alignment governs the amount of padding between sections of a file. In the running process image, different file sections are aligned on a 4KB boundary as that's the page size - different protections can only be set at page level.
There is almost never any reason to change the file alignment as the amount of wasted space is typically very small - there aren't many sections in a typical executable file - and disappears completely if the file is compressed, as it will be in most distribution systems.
"Multithreading is just one damn thing after, before, or simultaneous with another." - Andrei Alexandrescu
|
|
|
|
|
|
I just read this article: http://www.codeproject.com/KB/system/Hack_Windows_Task_Manager.aspx[^], and I thought it would be quite interesting if an app is able to modify one entry in task manager's listbox, thus hiding itself. It sounded easy enough to replace LVM_DELETECOLUMN with LVM_DELETEITEM, but I'm getting strange errors with SendMessage.
So right now I have something like this:
LVFINDINFO findInfo;
ZeroMemory(&findInfo, sizeof(LVFINDINFO));
findInfo.flags=LVFI_STRING;
findInfo.psz=(LPCSTR)"myTest.exe";
Then I tried this (hWnd is for Windows Task Manager, not my app):
int index = ::SendMessage(hWnd,LVM_FINDITEM,(WPARAM)0,(LPARAM)(const LVFINDINFO FAR*)&findInfo);
if (index!=-1) ::SendMessage(hWnd,LVM_DELETEITEM,index,0);
It crashes taskmgr.
I was browsing through the comments on that article when I found a piece of code in Delphi that supposedly does what I'm trying to do. After my attempt to translate it into C++, it looks like this:
DWORD ProcessID;
GetWindowThreadProcessId(hWnd,&ProcessID);
HANDLE pHandle=OpenProcess(PROCESS_ALL_ACCESS,FALSE, ProcessID);
if (pHandle!=NULL){
LPVOID address=VirtualAllocEx(pHandle,NULL,sizeof(findInfo),MEM_RESERVE | MEM_COMMIT,PAGE_READWRITE);
if (WriteProcessMemory(pHandle,address,&findInfo,sizeof(findInfo),NULL)!=FALSE){
int index = ::SendMessage((HWND)pHandle,LVM_FINDITEM,(WPARAM)0,(LPARAM)(const LVFINDINFO FAR*)address);
if (index!=-1) ::SendMessage(hWnd,LVM_DELETEITEM,index,0);
}
CloseHandle(pHandle);
VirtualFreeEx(pHandle,NULL,sizeof(findInfo),MEM_DECOMMIT);
}
Unfortunately, that doesn't work either. The LVM_FINDITEM SendMessage returns 0, so all it's doing right now is deleting the first entry off taskmgr every 10 milliseconds.
If anyone could correct me on my usage of SendMessage with LVM_FINDITEM that would be appreciated. 
|
|
|
|
|
Did you also allocate the string (stored in findInfo.psz ) in the other process's address apace?
|
|
|
|
|
I don't quite understand what you just said.
The listbox that I'm searching does have the entry "myTest.exe", if that's what you're saying.
|
|
|
|
|
Thank U for valuble question.
The suggestion for allocating string other process worked well, but i need to set the postion for that i have to use LVM_SETITEMPOSITION, how can i create the POINT value in the other process.
Thanks in advance.----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
Another way to hide entries would be to hook the ZwQuerySystemInformation API, which Task Manager calls to get a list of the running processes on the system. You can modify the linked list of processes returned by changing around the NextEntryDelta member of the SYSTEM_PROCESS_INFORMATION struct once the process is found (ProcessName member). I don't really see why you'd want to hide a process from Task Manager though -- outside of malicious purposes.
|
|
|
|
|
I get dizzy everytime I look at something related to drivers. You DO need to create a driver to hook the ZwQuerySystemInformation API right? I've been trying to learn how to hook the NT kernel functions for a long time now, and I'm not getting anywhere. There aren't any good tutorials
And also, that isn't really my goal. As I said in my post, I just read an article on modifying Task Manager's listboxes and I was curious if that meant a process could be able to hide itself. I'm not doing this for any malicious purposes. Just doing it to satisfy my curiosity 
|
|
|
|
|