|
|
|
[原创]文件运行后自删除的汇编代码
LZ你运行过你的程序吗? del 能直接删除正在运行的文件???? 带着怀疑的态度,我运行了你的代码。结果没有让我惊讶。失败了 如果一句del就能搞定的话, 那WinDos2K的那段代码就不会成为经典了 |
|
[原创]小菜也学内核笔记---前提知识
这也叫笔记。。这能叫教程了。。。。。 |
|
|
|
|
|
[求助]请大大们帮个忙(关于vc中的问题)
从头学起,学消息机制 |
|
求助C程序一个
#include <windows.h> #include "Shlwapi.h" #pragma comment(linker,"/subsystem:windows"); #define EditID 1 #define ButtonID 2 LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,PTSTR szCmdLine,int iCmdShow) { WNDCLASS wndcls; wndcls.cbClsExtra=0; wndcls.cbWndExtra=0; wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH); wndcls.hCursor=LoadCursor(NULL,IDC_ARROW); wndcls.hIcon=LoadIcon(NULL,IDI_APPLICATION); wndcls.hInstance=hInstance; wndcls.lpfnWndProc=WinSunProc; wndcls.lpszClassName="windows"; wndcls.lpszMenuName=NULL; wndcls.style=CS_HREDRAW | CS_VREDRAW; RegisterClass(&wndcls); HWND hwnd; hwnd=CreateWindow("windows","Make By 泥芭",WS_OVERLAPPEDWINDOW, 0,0,300,150,NULL,NULL,hInstance,NULL); ShowWindow(hwnd,SW_SHOWNORMAL); UpdateWindow(hwnd); MSG msg; while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { HWND hEdit; HWND hButton; CHAR wStr[1024]="0"; switch(uMsg) { case WM_DESTROY: PostQuitMessage(0); break; case WM_CREATE: hEdit=CreateWindowEx(NULL,"Edit",NULL,WS_CHILD|WS_VISIBLE|WS_BORDER,10,30,120,25,hwnd,HMENU(EditID),NULL,NULL); hButton=CreateWindowEx(NULL,"button","确定",WS_CHILD|WS_VISIBLE|WS_BORDER,120,30,60,25,hwnd,HMENU(ButtonID),(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), NULL); case WM_COMMAND: if ((lParam!=0)&&((wParam&0xffff)==ButtonID)) { GetDlgItemText(hwnd,EditID,wStr,1024); if (StrCmp(wStr,"123456")) { MessageBox(NULL,"密码错误!",NULL,MB_OK); } else { MessageBox(NULL,"密码正确","恭喜",MB_OK); } } default: return DefWindowProc(hwnd,uMsg,wParam,lParam); } return 0; } |
|
|
|
|
|
怎样可以使这个窗口移动-有更新
把软件传上来才能写 |
|
求助C程序一个
控制台的用 5楼或者9楼的都可以,都是完整代码 下面这个是window窗口的,我看你要的是直接复制就可以编译的代码, 就仿照汇编的风格写了这个,笫一次用SDK写 #include <windows.h> #include "Shlwapi.h" #define EditID 1 #define ButtonID 2 LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,PTSTR szCmdLine,int iCmdShow) { WNDCLASS wndcls; wndcls.cbClsExtra=0; wndcls.cbWndExtra=0; wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH); wndcls.hCursor=LoadCursor(NULL,IDC_ARROW); wndcls.hIcon=LoadIcon(NULL,IDI_APPLICATION); wndcls.hInstance=hInstance; wndcls.lpfnWndProc=WinSunProc; wndcls.lpszClassName="windows"; wndcls.lpszMenuName=NULL; wndcls.style=CS_HREDRAW | CS_VREDRAW; RegisterClass(&wndcls); HWND hwnd; hwnd=CreateWindow("windows","Make By 泥芭",WS_OVERLAPPEDWINDOW, 0,0,300,150,NULL,NULL,hInstance,NULL); ShowWindow(hwnd,SW_SHOWNORMAL); UpdateWindow(hwnd); MSG msg; while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { HWND hEdit; HWND hButton; CHAR wStr[1024]="0"; switch(uMsg) { case WM_DESTROY: PostQuitMessage(0); break; case WM_CREATE: hEdit=CreateWindowEx(NULL,"Edit",NULL,WS_CHILD|WS_VISIBLE|WS_BORDER,10,30,120,25,hwnd,HMENU(EditID),NULL,NULL); hButton=CreateWindowEx(NULL,"button","确定",WS_CHILD|WS_VISIBLE|WS_BORDER,120,30,60,25,hwnd,HMENU(ButtonID),(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), NULL); case WM_COMMAND: if ((lParam!=0)&&((wParam&0xffff)==ButtonID)) { GetDlgItemText(hwnd,EditID,wStr,1024); if (StrCmp(wStr,"123456")) { MessageBox(NULL,"密码错误!",NULL,MB_OK); } else { MessageBox(NULL,"密码正确","恭喜",MB_OK); } } default: return DefWindowProc(hwnd,uMsg,wParam,lParam); } return 0; } |
|
|
|
求助C程序一个
#include "stdio.h" #include "string.h" #include "conio.h" void main() { char pwd[]="123456"; char str[7]; printf("Please enter the password!\n"); scanf("%s",str); while(strcmp(pwd,str)!=0) { printf("Password Error!\n"); fflush(stdin); scanf("%s",str); } printf("Conglatulations!\n"); getche(); //后面是你程序的方要代码 } |
|
[求助]请问下面的代码为什么接收不到WM_CREATE消息
多谢zerostudy,DialogBoxParam是不能处理WM_CREATE消息的? 我是想在对话框创建的时候做一些判断,再根据判断结果来动态的创建一个编辑框。 在WM_INITDIALOG消息中调用CreateWindowEx创建编辑框应该是不行的。我试过没效果。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值