Click here to Skip to main content
15,885,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the feature of desktop window class?
//Why do I have to type the sentence which is at least 30 charachers?(Has been solved.)
Here is my code.
#include <stdio.h>
#include <windows.h>
#pragma comment (lib, "user32.lib")
#include <Psapi.h>
#pragma comment(lib,"Kernel32.lib")

main(){
	FILE *fp = fopen("C:/windowLog.txt", "a");
	HWND desktopWindow=GetDesktopWindow();
	fprintf(fp, "Handle of Desktop window is%x\n", (unsigned int)desktopWindow);
	CHAR dName[MAX_PATH] = { 0 };
	GetWindowTextA(desktopWindow, dName, MAX_PATH);
	fprintf(fp, "Title of desktop window is %s\n", dName);
	GetClassName(desktopWindow, dName, MAX_PATH);
	fprintf(fp, "Desktop window class is %s\n", dName);
	DWORD pid = 0;
	GetWindowThreadProcessId(desktopWindow, &pid);
	HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
	CHAR path[260] = { 0 };
	GetModuleFileNameEx(hProcess, NULL, path, 260);
	fprintf(fp, "The path of the process is %s\n\n", path);
	fclose(fp);
}

The reslut of"Desktop window class" is "#32769".
Would you please tell me the details of the"window class"?

What I have tried:

I have found out the class name.
But I don't know how to find out the feature.
Posted
Updated 7-Apr-18 2:49am
v2

Let's answer these in reverse.
Quote:
Why do I have to type the sentence which is at least 30 charachers?
To make you think about what you are asking, and to prompt you to give a reasonable amount of information. The better the info, the better your question. The better your question, the better an answer we can give!
Asking questions is a skill: it focuses your mind and what you want to know, and can often give you the answer without having to ask anyone else...

Quote:
What is the feature of desktop window class?
...
I have found out the class name.
But I don't know how to find out the feature.
So start with the official documentation: Object Class (System): MSDN[^] and you will find all you need to know.
If you want to know about a specific class (and there are no classes in C at all, it doesn't even have the concept of them) then start with google and type the name of the class followed by the language you want to use. For example "Form C#" will give you this: Form C# - Google Search[^] and the first hit in the list is the MSDN documentation for the Form class: Form Class (System.Windows.Forms): MSDN[^]
 
Share this answer
 
Comments
quanhuang 7-Apr-18 8:48am    
Thank you!
OriginalGriff 7-Apr-18 10:12am    
You're welcome!
Not sure what you are asking, but see:

About Window Classes (Windows)[^]

GetDesktopWindow function (Windows)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900