|
hi all,
I m working on in VC++ 6.0 on windows XP platform.
I want to disable the print screen on the keyboard wherever my application starts and enable it whenever application exit.can anyone help me out.
regards,
kapil kant
|
|
|
|
|
you should check out the SetWindowsHookEx[^] function which is supported on WinNT, 2000 and XP.
This will let you set a low-level keyboard hook.
There is an article[^] on MSDN which describes the use of a low-level hook.
Enjoy!
Don't think you are, know you are...
|
|
|
|
|
void CPrintDlg::OnBPrint()
{
ShellExecute(NULL, "print", "c:\\Print\\myfile.doc", NULL, NULL, 0);
}
We Believe in Excellence
|
|
|
|
|
Uhh yeah... and your question is...?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
Inside a View class (CChildView), I call CDialog. The Dialog pops up. Now, how can I talk to the CChildView while the Dialog still shows?
Say CChildView display a bitmap; in my dialog, I change the zoom parameter to 2x, I want the image to reflex the change immediately in the CChildView.
Thank you in advance,
|
|
|
|
|
What about defining an user message (WM_APP + something) and post it/ send it from the dialog to the view?
Fold With Us!
What a sad world it would be if everyone said and did only what was easy - Shog9
|
|
|
|
|
Do I define WM_APP message in View and from Dialog I do: this->SendMessage(WM_DO_STUFF,0,0)?
I did that, but it didn't work out.
Thanks
|
|
|
|
|
* Is your dialog modal or modeless?
* Try to use PostMessage instead of SendMessage
you should have in <myapplication.h>:
#define WM_DO_STUFF WM_APP+1
In <myview.h>
<br />
BEGIN_MESSAGE_MAP(CMyView, CView)<br />
[...].br />
afx_msg LRESULT OnDoStuff(WPARAM wParam, LPARAM lParam);<br />
END_MESSAGE_MAP()<br />
In <myview.cpp>
<br />
BEGIN_MESSAGE_MAP(CMyView, CView)<br />
[...].br />
ON_MESSAGE(WM_DO_STUFF, OnDoStuff)<br />
END_MESSAGE_MAP()<br />
<br />
LRESULT CMyView::OnDoStuff(WPARAM wParam, LPARAM lParam)<br />
{<br />
return 0L;<br />
}<br />
in <mydialog.cpp> (CMyDialog must know about the view)
<br />
void CMyDialog::OnActionButton()<br />
{<br />
ASSERT(m_pMyView);<br />
m_pMyView->PostMessage(WM_DO_STUFF);<br />
}<br />
HTH,
Fold With Us!
What a sad world it would be if everyone said and did only what was easy - Shog9
|
|
|
|
|
Thank you K,
I finally passed a pointer of MyView to Dialog and access functions in MyView such as Invalidate and other member functions through this pointer.
Thanks,
|
|
|
|
|
Hi K,
I finally passed a MyView pointer to CDialog through constructor. Thus, I can access MyView member functions from CDialog. However, when I clicked OK on the Dialog, the program crashed. My guess is that I don't know how to delete the *pView that I passed to Dialog. I delete it in the contructor Dialog destructor). Any thought?
By the way, it is a Modal dialog.
Thanks,
|
|
|
|
|
Hi,
I have 2 win2003 servers which are in different domain say domain1 and domain2. The domains are under a forest with proper trust relationships established. I need to access registry of server in domain2 from an application on machine in domain1. I have set appropriate access permissions and allowed paths as mentioned below.
1. domain2 server - HKLM\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg\AllowedPaths - contains registry key to be allowed access
2. domain2 server - Granted full permissions to everyone to actual registry key
With this I am not able to connect to remote registry using "RegConnectRegistry" API. Is cross domain registry access allowed in windows? If so what additional settings needs to be done?
Thanks
JA
|
|
|
|
|
Are you able to logon to IPC$ of the server of which you want to access the registry ?
suhredayan There is no spoon.
|
|
|
|
|
i am able to log to ipc. I am also able to connect to remote registry but it remains in read-only mode.
if tried to connect using regconnectregistry api, it fails. do i need to specify any trust relationships or forest levels for this to be working?
|
|
|
|
|
Hi,
I'm trying to recreate the Polygon API with filling. I'm using Polyline. Is there a filling algorithm I can use to do the exact same thing that Polygon does?
Thanks
|
|
|
|
|
Books:
Michael Abrash Graphics Programming. (best choice)
Foiley and Van Dam. (lots of info.)
Graphics Gems. (may be)
You should be able to find an implimentaion at a graphics or gaming sight.
http://sourceforge.net (a good place to look for libraries and applications.)
If you search for "Michael Abrash" or "Foiley and Van Dam" you should find some hits.
Well I hope that helps narrows the search.
Good luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I'm currently developing a context menu shell extension. I'm trying to create something similar to the Windows Picture and Fax viewer in that it is the default action for the specified filetype. Google assisted me in finding the MayChangeDefaultMenu registry tweak, so doubleclicking a hooked file fires my extension, however, when a file is executed with ShellExecute/Ex, it isn't. Is there a way to set my extension as the *official* default action so that ShellExecute/Ex will fire my extension?
One method I can think of doing would be to register a normal file command via and set that as the default, then somehow make that command's menu entry invisible so that it exists only for the purpose of being the default action. Possible?
Any other suggestions are welcome of course...
|
|
|
|
|
When I create an application. Do the files my app uses (such as files the user can load) have to have an extension of only 3 characters? If so, how do I determine what extensions are already in use to ensure that my extensions are unique and have their own icon?
|
|
|
|
|
JKallen wrote:
Do the files my app uses (such as files the user can load) have to have an extension of only 3 characters?
three is typical, but you can have extensions of any length you like. ex: .JS, .CONFIG, .FOO.
JKallen wrote:
If so, how do I determine what extensions are already in use to ensure that my extensions are unique and have their own icon?
strictly speaking, you can't. nobody keeps an authoratative list of file extensions. the best you can do is search the web (and your system registry) to see if you can find a match.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
Thanks. that's what i figured. How do I have the OS associate an extenion with an icon? Secondly what happens if the extension already exists on the PC via installation of another app?
|
|
|
|
|
hi,
if you guys could tell me how do i get the project path or the handle tht hold it . it would be gr8.
thanks for the help
Chintan
|
|
|
|
|
Are you looking to get the path of you exe? If so, use getmodulefilename().
suhredayan There is no spoon.
|
|
|
|
|
I cannot create a working connection. I need help. Here is my source:
#include <winsock.h>
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
string itos(int x){
ostringstream sStream;
sStream<<x<<flush;
return(sstream.str());
}
int="" main(int="" argc,="" char="" *argv[]){
="" fills="" array="" with="" ips
="" string="" iparray[255];
="" subnetarray[1]="192.168.1" ;
="" int="" rangestart,rangeend;
="" rangestart="5;
" rangeend="5;
" index="0;
" for(int="" x="rangeStart;x<=rangeEnd;x++){
" iparray[index]="subnetArray[0]+".";
" tmp="itos(x);
" iparray[index]+="tmp;
" index++;
="" }
="" wsa="" startup
="" wsadata="" wsadata;
="" if(wsastartup(makeword(1,1),&wsadata)!="0){
" cout<<"wsastartup="" failed!\n";
="" system("pause");
="" return="" exit_success;
=""
="" socketdescriptor;
="" socketdescriptor="socket(AF_INET,SOCK_STREAM,0);
" if(socketdescriptor<0){
="" cout<<"socket="" creation="" serverport="20100;
" struct="" hostent="" *hostinfo;
="" sockaddr_in="" serveraddress;
="" ip[20];
="" strcpy(&ip[0],iparray[index].c_str());
="" cout<<ip;
="" hostinfo="gethostbyname(IP);
" serveraddress.sin_family="hostInfo-">h_addrtype;
memcpy((char *)&serverAddress.sin_addr.s_addr,hostInfo->h_addr_list[0],hostInfo->h_length);
serverAddress.sin_port=htons(serverPort);
//cout<<endl<<endl<<serveraddress.sin_addr.s_addr;
if(connect(socketdescriptor,(struct="" sockaddr*)&serveraddress,sizeof(struct="" sockaddr))="=-1){
" cout<<"="" not="" connected"<<endl;
="" }
="" else{
=""
="" system("pause");
="" return="" exit_success;
}
and="" the="" other:
#include="" <winsock.h="">
#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
//wsa startup
WSADATA wsaData;
if(WSAStartup(MAKEWORD(1,1),&wsaData)!=0){
cout<<"WSAStartup failed!\n";
system("PAUSE");
return EXIT_SUCCESS;
}
int socketDescriptor;
socketDescriptor=socket(AF_INET,SOCK_STREAM,0);
if(socketDescriptor<0){
cout<<"Socket creation failed!\n";
system("PAUSE");
return EXIT_SUCCESS;
}
struct sockaddr_in myAddr;
myAddr.sin_family=AF_INET;
int serverPort=420100;
myAddr.sin_port=htons(serverPort);
char myIP[16];
gethostname(myIP,16);
myAddr.sin_addr.s_addr=inet_addr(myIP);
cout<<myip<<endl;
="" struct="" hostent="" *h;
="" h="gethostbyname(myIP);
" cout<<"hostname:="" "<<h-="">h_name<<endl;
cout<<"ip:="" "<<inet_ntoa(*((struct="" in_addr*)h-="">h_addr))<
|
|
|
|
|
Well, I haven't actually tried to validate your code yet, but it looks like you are trying to listen on port 420100 on the server app (which is out of the range of acceptable ports, it's over 65535), and the client is trying to connect to port 20100. You need to connect to the port that's being listened on. I'm assuming it's just a typeo in your code that you put 420100 instead of 20100 on the server side.
-- Rocky Dean Pulley
|
|
|
|
|
He, he. What a dumb mistake by me. But I still get the same problem. I cannot get the two to connect, even now that I am listening and connecting using the same port. Oh, I used Dev-C++ for compiling if you wanted to give it a go.
|
|
|
|
|
i need a way that i can search the harddrive for a paticular file type
|
|
|
|