|
use fantasy...
- put in on a http server, download it from there on demand?
- put it into a resource dll, load the dll on demand and get the data?
- recreate file as JPG which has your data as payload in the JPG-comment section?
But sounds all like script kiddie solutions, I would simply do NOT hide the file and encrypt it... or tell your g/f to not use your login.
|
|
|
|
|
The EN_CHANGE notification message is sent when the user has taken an action that may have altered text in an edit control. Unlike the EN_UPDATE notification message, this notification message is sent after the system updates the screen. The parent window of the edit control receives this notification message through a WM_COMMAND message.
This is written in the MSDN.
so i 've made a callback function in my w32 api for the dialog that contains the Edit Control like this:
long FAR PASCAL fereastra1(HWND hdlg1,WORD wmessage1,WPARAM wparam1,LPARAM lparam1)
{
switch(wmessage1)
{
case WM_COMMAND:
switch (wparam1)
{
case IDC_LIST1:
switch(lparam1)
{
case 0x0300:
MessageBox(NULL,"modified","HGabby",MB_OK);
break;
case EN_UPDATE:
MessageBox(NULL,"modified","HGabby",MB_OK);
break;
}
case IDOK:
EndDialog(hdlg1,0);
break;
}
break;
}
return 0;
}
can you tell me please how should I handle this problem
When I do it in mfc it works. I mean each time I modifi the edit box a message box appears. I want to do it in a w32 api. so please help me
thankx
gabby
|
|
|
|
|
Add one more break to your code.
It should work now.
long FAR PASCAL fereastra1(HWND hdlg1,WORD wmessage1,WPARAM wparam1,LPARAM lparam1)
{
switch(wmessage1)
{
case WM_COMMAND:
{
switch (wparam1)
{
case IDC_LIST1:
{
switch(lparam1)
{
case 0x0300:
MessageBox(NULL,"modified","HGabby",MB_OK);
break;
case EN_UPDATE:
MessageBox(NULL,"modified","HGabby",MB_OK);
break;
}
}
break;
case IDOK:
EndDialog(hdlg1,0);
break;
}
break;
}
return 0;
}
|
|
|
|
|
This is a working code:
LRESULT CALLBACK wndproc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
else if(LOWORD(wParam) == IDC_EDIT1)
{
switch(HIWORD(wParam))
{
case EN_CHANGE:
MessageBox(NULL,"EN_CHANGE","Edit Notify",MB_OK);
return TRUE;
case EN_UPDATE:
MessageBox(NULL,"EN_UPDATE","Edit Notify",MB_OK);
return TRUE;
}
}
break;
}
return FALSE;
}
____________________
A.M.
|
|
|
|
|
I have written an NT service that starts automatically when the system boots. It seems to work fine until I set the machine to go into stand-by mode after a specified period of time and eventually power down the monitor and disk drives after an additional specified time.
I have had successful test runs of 5+ hours without any apparent difficulty but when I changed the settings to the ones mentioned above I get an access violation in MSVCRT.DLL (not my dll). The information message gives me an instruction address in the MSVCRT.DLL and some target address saying that the memory could not be written.
Although the service still indicates that it is running, in the Administrative Tools ==> Services dialog, it is dead in the water, as indicated by an application progress log. Additionally I cannot attach a debugger to it. Not being able to attach a debugger to the process limits the definitive information I can gather about this point of failure.
What I suspect is happening is that the monitor powers down due to prolonged inactivity. I do not think the disks are also powered down at this point because the service is still running or if the service was suspended when the system went into stand-by mode some specified time before the monitor power down is initiated. In either case the disks would power down after the monitor because inactivity would have occured in the monitor some time before the system actually went into stand-by mode or prolonged disk inactivity. From here I am just guessing but it seems, from the name of the dll, like the service is trying to access a buffer associated with the monitor which has been freed when the monitor initiated a power down or power up sequence.
The file version of MSVCRT.DLL is 7.0.2600.2180 (xpsp_sp2_rtm.040803-2158).
My question is if anyone knows of a way to get signeled when the machine makes the transition to/from stand-by or hibernate modes, and when the monitor or disks initiate a power down or power up sequence.
If the process can be signaled then it can be put into a paused state until the machine and\or monitor and disks wake up again and should be able to continue processing.
|
|
|
|
|
i think you are looking for winlogon notification package.
there is very good article over it in CP,search Winlogon at CP
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank you for the response. It made interesting reading for future reference but Winlogon.exe doesn't expose the events I am looking for.
I need to find a similar program that exposes system transitions to/from stand-by and hibernate, as well as the monitor and disks powering down and up again.
|
|
|
|
|
I think this is what youw ere ater originally...
Your service needs to be written with HandlerEx instead of just handler.
Then you should get the SERVICE_CONTROL_POWEREVENT control code.
"A HandlerEx function is an application-defined callback function used with the RegisterServiceCtrlHandlerEx function. A service program can use it as the control handler function of a particular service."
"If dwControl is SERVICE_CONTROL_POWEREVENT, this parameter can be one of the values specified in the wParam parameter of the WM_POWERBROADCAST message."
"WM_POWERBROADCAST - Power-management event. This parameter can be one of the following events. Event Meaning
PBT_APMBATTERYLOW Battery power is low.
PBT_APMOEMEVENT OEM-defined event occurred.
PBT_APMPOWERSTATUSCHANGE Power status has changed.
PBT_APMQUERYSUSPEND Request for permission to suspend.
PBT_APMQUERYSUSPENDFAILED Suspension request denied.
PBT_APMRESUMEAUTOMATIC Operation resuming automatically after event.
PBT_APMRESUMECRITICAL Operation resuming after critical suspension.
PBT_APMRESUMESUSPEND Operation resuming after suspension.
PBT_APMSUSPEND System is suspending operation."
|
|
|
|
|
Excellent!
These are the events I need to monitor.
I am assuming that in order to hibernate the machine will give some of these events also, probably the request to suspend. I can figure that out easily in unit test.
Thank you
JimmyRopes
|
|
|
|
|
I write program to comunicate by Serial Port. I use the event comunication.
While i use the program, sometime, the directory of PC go in stall.
Why?
And other pbm: With only windows Xp i lose the communication.
thank you very much
Joshua
|
|
|
|
|
Hello,
I am working with CFile in MFC. I want to set attributes of this file in such a way that one application can read data from it while the other application is writing data to it. Can anyone please help me to do this?
Thanks
Madhavi
|
|
|
|
|
Hi,
try this method
file Write Application
------------------
CFileStatus Status;
CFile oFile;
oFile.GetStatus ("yourFile.txt),status);
if ( status.m_attribute == readonly )
{
status.m_attribute = write
oFile.SetStatus(("yourFile.txt),status);
//Write to your file code goes from here
//change Status to Back to Readonly
status.m_attribute = readonly;
oFile.SetStatus(("yourFile.txt
}
Read Applicatio]n
-----------------------------------
use Open Readonly Mode Method
OR You Can Use Inter process communication ,it's a better solution rather than first one
by
baijumax
|
|
|
|
|
The attributes shown bellow are for already created file.
Reading app: CFile::modeRead|CFile::shareDenyRead .
Writing app: CFile::modeWrite|CFile::shareDenyWrite .
|
|
|
|
|
How can I repaint only part of a dialog box? I have a dialog that pops up while my program searches files, and I want to update the current file (like install programs do). I use a static text, but when the dialog is shown only the static text that is being updated is show, there is a "hole" where the button and two other static text objects are. Any ideas? Thanks!
|
|
|
|
|
you have to use some logic to solve your problem,
tell me the dialog which you popup is Modeless or model.
if Modeless,do a interprocess comunication by sending & recieving message and every time when you recive the message update the window.
or you send me the code i will do for you,but pls send a proper documentaion with it
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
|
i tried to link Matlab engine with VC++ 6. I got the following error
engwindemo.c
Linking...
MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/engwindemo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
engwindemo.exe - 2 error(s), 0 warning(s)
can anyone help me
|
|
|
|
|
Hi,i want to create a combo box and map a function to it.the function need be called according to the selection os the item in the list.Kindly send me simple samples.(note: i am in the incipient stages of learning this)
Prathiba
|
|
|
|
|
you need to handle the ON_CBN_SELENDOK and/or ON_CBN_SELCHANGE ( and maybe one or two other ) messages.
check MSDN for more info.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanx for ur reply.Your info was useful and i have made it.
Thanx once again
Prathiba
|
|
|
|
|
im trying to figure this sucker out, the idea i want to do is notify user MessageBox("hifile changed") when the file "1.txt" has been edited, but this hole FileSystemWatcher.OnChanged seems confusing, can anyone give me any suggestions or tutorials or examples? would be great!
thanks!
|
|
|
|
|
|
|
hai,
I am working on VC++ win32.I am creating a timer that decrements a counter every second(in Dlg Procedure).I have class where I have to reset the value of the timer.I am thinking of how to do this?
ie.
//main.cpp
int g_counter = 10;
main()
{
///here i decrement the timer every second
}
// myclass.cpp
int myclass::myfunction()
{
///here i want to set g_counter = 10;////how should i exactly do it..
}
|
|
|
|
|
manu81 wrote:
///here i decrement the timer every second
What function are you using to establish the timer?
manu81 wrote:
///here i want to set g_counter = 10;////how should i exactly do it..
You mean besides:
g_counter = 10;
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|