|
birajendu wrote: It is giving 12006 "The URL scheme could not be recognized, or is not supported." error.I tried with giving "google.com" in url field
You tried passing "google.com" as the lpszUrl field value?
The documentation has a description for this field, and that says: Pointer to a null-terminated string that specifies the URL[^] to use to check the connection. Notice that URL has a syntax.
A valid URL that can be passed as lpszURL would look like: _T("http://www.google.com")
Also, take a look at the example provided in MSDN for InternetGetConnectedState[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
> I am basicaly using win32
Then you can see on Advanced Win32 ng
news://nntp.aioe.org/comp.os.ms-windows.programmer.win32
or http://tinyurl.com/cmhb5g
(official methods, used in Windows Shell...)
|
|
|
|
|
I am capturing the screen by using GetDesktopWindow(). Now I want that when ever desktop (captured screen)changes/updates, I get the information, so that I would capture it again.
I have heard the word " window hooks" but do not know how to apply it. please guide?
The application is MFC based.
|
|
|
|
|
|
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)
{
int x=12;
if (nCode==HCBT_MINMAX)
{
AfxMessageBox(_T("Called"));
}
return 0;
}
CSDITESTView::CSDITESTView()
{
SetWindowsHookEx(WH_CBT,&CBTProc,NULL,0);
}
After reading the mentioned article, I wrote these lines, but it is not working? I am expecting that when I minimize the window , the associated call back function should be called.
|
|
|
|
|
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)
{
int x=12;
if (nCode==HCBT_MINMAX)
{
AfxMessageBox(_T("Called"));
}
return 0;
}
CSDITESTView::CSDITESTView()
{
SetWindowsHookEx(WH_CBT,&CBTProc,NULL,0);
}
After reading the mentioned article, I wrote these lines, but it is not working? I am expecting that when I minimize the window , the associated call back function should be called.
|
|
|
|
|
Hello i searched on the web but didnt find any good info how to do it. Could anyone post a example or refer me somewhere where i can read up on them i would like to hook a function using opcodes.
Thnx
|
|
|
|
|
NT based API hooking is also good
is it really necessary for you to hook with the functions using op codes.
otherwise my suggestion is
NT based :-
API hooking revealed[^]
kernel based:-
API Hooking (LoadLibrary)[^]
Величие не Бога может быть недооценена.
|
|
|
|
|
great sugestions but i would like to really know about more how to hook functions using opcodes...
|
|
|
|
|
In order to properly perform the type of hook operation you are describing you will need to implement some type of code relocation functionality. This is typically done by relocating one opcode at a time until enough memory is available to insert the patched code (or hook). This requires that each opcode and any operands be decoded and then encoded at a new location. Simply copying the opcode may not be sufficient if it uses relative addressing. From a top level view you would typically do the following:
1. Allocate enough memory for the original code to be copied to. See VirtualAllocEx() in the Windows SDK.
2. Decode a single opcode.
3. Encode/assemble the opcode at it's new location.
4. Repeat steps 2 and 3 until there is enough memory available to insert the hook.
5. Insert a jmp operation at the end of the relocated opcodes. This typically points to the end of the decode stream (or pointer if you prefer).
6. Insert the hook code (typically a jmp to your code).
You end up with something like this:
Before code relocation
user code -> | LoadLibrary (movable) | LoadLibrary main code
After code relocation
user code -> * jmp to your code * LoadLibrary main code
| |
| |
your code -> LoadLibrary (moved)
Before you begin you will probably want to familiarize yourself with the target CPU. Assuming that you are targeting Intel platforms visit "Intel® 64 and IA-32 Architectures Software Developer's Manuals[^]" for a list of references.
The reference manuals will tell you how each instruction is composed and what if any operands need to be processed. It will also tell you how each operand is composed, which addressing modes apply to each opcode and give you a list of all opcode modifiers (prefix bytes) and what they mean.
For an example of how to decode an opcode check out http://udis86.sourceforge.net/[^]
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
thnx very informative il start following you tips, thnx much !!!
|
|
|
|
|
Hi,
How can I disable Tree Item?
I think we can not, we just make a illusion of disable if yes then tell me how to set the color and font of individual item?
|
|
|
|
|
|
This code is giving error:
error C2039: 'SetItemStateEx' : is not a member of 'CTreeCtrl'
code is:
Ctrl->SetItemStateEx(hItem,TVIS_EX_DISABLED);
|
|
|
|
|
which VC version you are using?
Величие не Бога может быть недооценена.
|
|
|
|
|
|
Actually that is avail in VS2008 onwards.
Величие не Бога может быть недооценена.
|
|
|
|
|
I am using VS2010. i still face this issue.
|
|
|
|
|
In a C/C++ code I want to find the number of ticks in one millisecond / second.
How can I do that?
RKP
|
|
|
|
|
if u are looking to check the performance then
best is
To get the accuracy in milliseconds
GetTickCount
Get with the best accuracy
QueryPerformanceFrequency
QueryPerformanceCounter
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks ARJ09 for the reply.
Yes I am checking the performance of function which is to be called at a specific interval. The time in millisecond is not that accurate. But I am able to get a tick count of 3,4. So I want to know there are how many ticks in one millisecond. Rather I am asking 1 tick = ___ millisecond?
RKP
|
|
|
|
|
QueryPerformanceFrequency
Величие не Бога может быть недооценена.
|
|
|
|
|