|
You must be know c++ very good so if we suppose your knowledge is good in this sphere do you know security alert about some functions for example you want to use of wsprintf Function[^] or signature of viruses?
|
|
|
|
|
I know about the wsprintf but not about the signature of the virus
Trioum
|
|
|
|
|
Person in shop: Excuse me, how much is that huge diamond ring?
Shopkeeper: If you have to ask, you can't afford it.
Same sort of answer to your question... (maybe a little more polite!)
There are so many different (and hard) things you need to know, and if you're starting from zero (even a skilled zero), a simple answer here won;t help.
I wish you luck though!
Iain.
|
|
|
|
|
trioum wrote: Hi want to develope my own antivirus software . can any one suggest me with type of programming I neeed and any help regarding this on windows system .
The best way to go would be to refer to an open source anti-virus[^] program.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
i have a dialog based application. i want to display a popup menu when user clicks on button on a dialog and user should be able to select any of the items(from popped up menus after clicking on button).
for example:in code project when user moves mouse on message boards and when user clicks on c++/mfc then it will direct to forum for c++/mfc. how can i do this?
thanks in advance.
|
|
|
|
|
You can use of WM_CONTEXTMENU.
|
|
|
|
|
could u plz explain with some demo examples?
|
|
|
|
|
|
Anjali Patil wrote: i have a dialog based application. i want to display a popup menu when user clicks on button on a dialog and user should be able to select any of the items(from popped up menus after clicking on button).
Check out this simple tutorial[^].
But the tutorial explains how to display popup menu when you right click on a button. Since you want to show your menu during button click, I'll explain how to do it, in the context of the tutorial. Just add the button click event handler, then call the OnContextMenu() explained in the tutorial. Hope it helps.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
hi Jijo raj,
thank you for helping me.
still it is not working. i did as:
afx_msg void OnContextMenu(CWnd *pWnd,CPoint pos);
ON_BN_CLICKED(IDC_BUTTON1, OnContextMenu)
void IRCNewSim::OnContextMenu(CWnd *pWnd,CPoint pos)
{
// CMessage1 ob1;
// ob1.DoModal();
CMenu mnuPopupSubmit;
mnuPopupSubmit.LoadMenu(IDR_MENU2);
// Get a pointer to the button
CButton *pButton;
pButton = reinterpret_cast<CButton *>(GetDlgItem(IDC_BUTTON1));
// Find the rectangle around the button
CRect rectSubmitButton;
pButton->GetWindowRect(&rectSubmitButton);
// Get a pointer to the first item of the menu
CMenu *mnuPopupMenu = mnuPopupSubmit.GetSubMenu(0);
ASSERT(mnuPopupMenu);
// Find out if the user right-clicked the button
// because we are interested only in the button
if( rectSubmitButton.PtInRect(point) ) // Since the user right-clicked the button, display the context menu
mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
}
mnuPopupMenu is getting NULL value
plz help me
|
|
|
|
|
Hai!
I posted the following question recently
I have a multiline edit box in my MFC application , it is also enabled with auto V-Scroll, after all the data is being displayed, it goes to the initial position, i have to scroll to the end, for data verification, is there any way to make the cursor to stay at the end or last position after printing all the data ?
Thankyou !
i got the replies as
CEdit medt
medt.LineScroll (medt.GetLineCount ());
but what is happening is each time the data is entered into the multiline edit box the scroll bar goes to initial position and then comes down, it appears like blinking,
what i need is it must go down first and then decrease the size of scrollbar and stay at the end when data printed on the multiline edit box is completed!
thanks!
|
|
|
|
|
Does the SetRedraw function help? You could stop the control updating it's view until you've finished adding data. Then setredraw(true), then invalidate it.
Hopefully that will stop flickering!
Iain.
|
|
|
|
|
the function looks excatly as the codeblock below like this :
I suspect that the function is virtual or something very werid but can this function be hooked really interested to do that. I have hooked standard apis and other functions but hooking this i have no idea how do do it if anyone helps it BE great thx.
char *__cdecl sub_1000F61C()
{
byte_10095AA0 = (unsigned __int8)byte_10090A14 ^ 0x62;
byte_10095AA1 = (unsigned __int8)byte_10090A11 ^ 0x8F;
byte_10095AA2 = (unsigned __int8)byte_10090A12 ^ 0xF;
byte_10095AA3 = (unsigned __int8)byte_10090A10 ^ 0x19;
byte_10095AA4 = (unsigned __int8)byte_10090A12 ^ 0xD;
byte_10095AA5 = (unsigned __int8)byte_10090A10 ^ 0x1B;
byte_10095AA6 = (unsigned __int8)byte_10090A14 ^ 0x3E;
byte_10095AA8 = (unsigned __int8)byte_10090A10 ^ 0x59;
byte_10095AA9 = (unsigned __int8)byte_10090A14 ^ 0x69;
byte_10095AA7 = (unsigned __int8)byte_10090A10 ^ 0x45;
byte_10095AAC = (unsigned __int8)byte_10090A13 ^ 0xE0;
byte_10095AAA = (unsigned __int8)byte_10090A13 ^ 0x8C;
byte_10095AAB = (unsigned __int8)byte_10090A11 ^ 0x93;
dword_10095BA0 = 12;
return &byte_10095AA0;
}
char byte_10095AA0
all the byte_andnumbers are declared as chars.
|
|
|
|
|
Uh, what do you want to do?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I want hook the function char *__cdecl sub_1000F61C()
char *__cdecl sub_1000F61C()
{
byte_10095AA0 = (unsigned __int8)byte_10090A14 ^ 0x62;
byte_10095AA1 = (unsigned __int8)byte_10090A11 ^ 0x8F;
byte_10095AA2 = (unsigned __int8)byte_10090A12 ^ 0xF;
byte_10095AA3 = (unsigned __int8)byte_10090A10 ^ 0x19;
byte_10095AA4 = (unsigned __int8)byte_10090A12 ^ 0xD;
byte_10095AA5 = (unsigned __int8)byte_10090A10 ^ 0x1B;
byte_10095AA6 = (unsigned __int8)byte_10090A14 ^ 0x3E;
byte_10095AA8 = (unsigned __int8)byte_10090A10 ^ 0x59;
byte_10095AA9 = (unsigned __int8)byte_10090A14 ^ 0x69;
byte_10095AA7 = (unsigned __int8)byte_10090A10 ^ 0x45;
byte_10095AAC = (unsigned __int8)byte_10090A13 ^ 0xE0;
byte_10095AAA = (unsigned __int8)byte_10090A13 ^ 0x8C;
byte_10095AAB = (unsigned __int8)byte_10090A11 ^ 0x93;
dword_10095BA0 = 12;
return &byte_10095AA0;
}
|
|
|
|
|
What do you mean with 'hook'? Since you have the source then you can make the intercepting code in place.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Actually i dont have the source its from a dynamic dll and i decompiled te function using hexrayz so i just want to know how do declare it and i want to ook it usin detours i doubt it can be intercepted but can ya explaine more mybe example of intercepting this function
|
|
|
|
|
At work I use Visual C++, programming for W2K and XP. We have a program that uses lots of "ocx"s, nearly all of which have property pages using COlePropertyPage. Nowadays, people have a lot of pixels on their screens and the property pages are getting a bit small. My boss asked me to look into enlarging the property pages.
I did this on one of the ocxs and got the warning message box: "Dimensions should be 250x62 or 250x110 dialog units." This is from the _ValidatePageDialog() function in ctlppg.cpp in the MFC/SRC directory. This debug only function checks for those dimensions using hard-wired numbers!
And although I enlarged the property pages in the resource file, they remained the same size when shown. So I'm wondering if anyone has a work-around for this: how can I make the property pages larger for an ocx?
Thanks for your help....
|
|
|
|
|
AVI capFileSaveDIB saves one AVI frame to bitmap file.
Is it possible to save AVI frame as bitmap directly to memory?
Constructive suggestions are appreciated.
Thanks for reading
Vaclav
|
|
|
|
|
When streaming, you can grab a frame from a callback set with
capSetCallbackOnVideoStream.
When not streaming, maybe capGrabFrame and a callback set with
capSetCallbackOnFrame.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is there a third option? Like maybe you can fish it out of some lake or something?
led mike
|
|
|
|
|
Hi,
I was wondering if any of the experts could tell me If my usage of Named Pipes For Interprocess communication Async. is correct
First Server code
CreateNamedPipe ... using FILE_FLAG_OVERLAPPED
Overlappeda.hEvent = CreateEvent(&sa,FALSE,FALSE,TEXT("EVENTA"));
OverLappedb.hEvent = CreateEvent(&sa,FALSE,FALSE,TEXT("EVENTB"));
// Wait For Cleint to Connect
ConnectNamedPipe....
Now Client Code
filehandle = CreateFile
Get PID of Parent
PHANDLE = OpenProcess
myeventa = OpenEvent("EVENTA");
myeventb = OpenEvent("EVENTB");
// Duplicate hEvent of Overlaped.hEvent Created By Server
DuplicateHande(...myevanta... (Target Handle) myoverlappeda.hEventa
CreateThread.... to wait for I/O from Server
Mythread code
// wait For I/O from Server
for (;;)
{
WaitForSingleObject(myoverlappeda.hEvent...
// Read I/O
ReadFile(filehandle
go to proper function in Client
}
One the things I am not sure of is the WaitForSingleObject before The ReadFile
or After
The Way i have it Coded now if The event in the WaitForSingleObject gets signaled
will it Readfile go into a Wait Again ????? or since the WaitForSingleObject
Says there is data everyting will work ???
Thankx
|
|
|
|
|
ForNow wrote: I was wondering if any of the experts could tell me If my usage of Named Pipes For Interprocess communication Async. is correct
Well we can't see your code because you didn't follow the posting instructions for source code for this web site. That said, if you followed the documentation instructions for implementing named pipes and overlapped I/O in the same fashion you did the code posting instructions for this site, there is almost zero chance that your implementation is correct.
Good luck
led mike
|
|
|
|
|
Just read the the instuctions on how to post a message
re: source code it mentions 2 options the first of which <pre> </pre> tags I dont understand so I'll take the second options Check ignore HTML tags
Here it is
Server Code
pipehandle = CreateNamedPipe ( pipe_name,
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
PIPE_UNLIMITED_INSTANCES,
buf_size,
buf_size,
PIPE_TIMEOUT,
NULL);
sa.nLength = sizeof(sa);
sa.lpSecurityDescriptor = NULL; // initailize security discriptor
sa.bInheritHandle = TRUE;
over_read.hEvent= CreateEvent(&sa,
FALSE, // let Windows Re-set
FALSE, // Intially set off
TEXT("eventread"));
over_write.hEvent= CreateEvent(&sa,
FALSE, // let Windows Re-set
FALSE, // Intially set off
TEXT("eventwrite"));
memset(&si,0,sizeof(si));
si.cb= sizeof(si);
return_code = CreateProcess(NULL,
(LPCSTR) &herc_buff[0],
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&si,
&pi);
return_code = ConnectNamedPipe (pipehandle,&over_lapp);
In Client
filehdl = CreateFile(pipe_name,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL);
myevent_read = OpenEvent(EVENT_ALL_ACCESS,FALSE,TEXT("eventread"));
myevent_write = OpenEvent(EVENT_ALL_ACCESS,FALSE,TEXT("eventwrite"));
parent_object = OpenProcess(PROCESS_ALL_ACCESS,FALSE,parent_process);
DuplicateHandle(parent_object,myevent_read,GetCurrentProcess(),overread.hEvent,0,FALSE,DUPLICATE_SAME_ACCESS);
DuplicateHandle(parent_object,myevent_write,GetCurrentProcess(),overwrite.hEvent,0,FALSE,DUPLICATE_SAME_ACCESS);
/* Create a thread to wait for Hercules to send back completed commands */
CreateThread(
NULL,
NULL,
my_thread_function,
lparam,
NULL,
&my_thread);
// code in my thread function
DWORD __stdcall my_thread_function(LPVOID lparam)
{
OVERLAPPED overwite;
char buffer[100];
int i;
while(1)
{
WaitForSingleObject(myevent_write,INFINITE,TRUE);
ReadFile(filehdl,
(LPVOID) &buffer[0],
100,
NULL,
(LPOVERLAPPED) &overwrite);
}
return 0;
}
Hope this is what u mean
|
|
|
|
|
ForNow wrote: Just read the the instuctions on how to post a message
Didn't read them very well then - there's a whole section on using the pre tag to keep formatting - and that also helps with for loops, as they look a bit like html...
(either that, or CP is messing up again. But I know which is more likely)
Iain.
|
|
|
|
|