http://zhidao.baidu.com/question/84802747.html
就是比如我打开D盘的aaa文件夹,窗口地址栏就是显示D:/aaa,请问我要怎么用VB写程序来获取窗口地址栏的内容?(不是IE的地址栏)
若打开了两个窗口,比如D盘的aaa文件夹和E盘的bbb文件夹下的ccc文件夹都打开的话,点击command1,text1就显示:
D:/aaa
E:/bbb/ccc
请大家帮忙下,谢谢!
http://www.programfan.com/club/showtxt.asp?id=215815
第4楼
我把程序贴出来给你看看吧:caseWM_CREATE:GetClientRect(hWnd,&wRect);//将程序窗口区域保存到结构变量wRect//建立复选框hButtonCi=CreateWindow(TEXT("BUTTON"),TEXT("圆"),BS_CHECKBox|WS_CHILD|WS_VISIBLE,wRect.left+50,wRect.bottom-80,75,25,hWnd,(HMENU)0,hInst,NULL);hButtonSq=CreateWindow(TEXT("BUTTON"),TEXT("矩形"),wRect.bottom-40,(HMENU)1,NULL);break;caseWM_COMMAND:if(LOWORD(lParam)==(long)hButtonCi){//读取复选框状态nCheck=(WORD)SendMessage(hButtonCi,BM_GETCHECK,0L);if(nCheck==TRUE)SendMessage(hButtonCi,BM_SETCHECK,0L);elseSendMessage(hButtonCi,1,0L);}elseif(LOWORD(lParam)==(long)hButtonSq){//读取复选框状态nCheck=(WORD)SendMessage(hButtonSq,0L);elseSendMessage(hButtonSq,0L);}InvalidateRect(hWnd,NULL,TRUE);break;wmId=LOWORD(wParam);wmEvent=HIWORD(wParam);//Parsethemenuselections:switch(wmId){caseIDM_ABOUT:DialogBox(hInst,MAKEINTRESOURCE(IDD_ABOUTBox),About);break;caseIDM_EXIT:DestroyWindow(hWnd);break;default:returnDefWindowProc(hWnd,message,wParam,lParam);}break;caseWM_SIZE:xc=LOWORD(lParam)/2;yc=HIWORD(lParam)/2;caseWM_PAINT:hdc=BeginPaint(hWnd,&ps);//TODO:Addanydrawingcodehere...//检查复选框以决定是否绘图nCheck=(WORD)SendMessage(hButtonCi,0L);if(nCheck==TRUE)Ellipse(hdc,xc-100,yc-100,xc+100,yc+100);nCheck=(WORD)SendMessage(hButtonSq,0L);if(nCheck==TRUE){MoveToEx(hdc,(LPPOINT)NULL);LineTo(hdc,yc-100);LineTo(hdc,yc+100);LineTo(hdc,yc-100);}EndPaint(hWnd,&ps);break;在后面的WM_SIZE中,控件句柄的值根本没有(与前面得到的句柄不一样),不知道是为什么? |