|
I want to add a toolbar in my win32 applicationn.....
Any Help?
Thankyou..
|
|
|
|
|
Do a search for Control Spy on MSDN. Control Spy is articles and source code showing how to work with toolbars and other win32 common controls.
|
|
|
|
|
Muzzamal wrote:
Any Help?
Ehhh, yes? The WWW world is full of examples of this. Not to mention you get it "for free" (not really, but close enough for your use) from MFC. It's all documented and with lots of examples.
|
|
|
|
|
I am sorry if I had chosen the invalid thread for my question.
I have a problem - I need to get the handles of all installed WH_KEYABOARD hooks in my system. Currently I need this for Win95/98/Me. I just know, that hooks are the USER objects, so there is a way to enumerate them. But MSDN does't say anything.
And one more question - is it possible to clear the hook chain retaining just mine and system - delete just user-installed?
I'll appriciate any suggestions and any help.
Thanks.
|
|
|
|
|
Hi,
I am in very New to VC, and I have written a code which will connect to another machine and return either a -1 or non negative value.
I am getting a "-1" for bind function. Please can some one help me
out with it..
==============================================================
#include <stdio.h>
#include <winsock.h>
#include <windows.h>
#include <iostream.h>
WSADATA wsData;
SOCKADDR_IN saServer;
SOCKET s;
void main()
{
WORD wVersionRequested = MAKEWORD(1,1);
int nRet,sd,d;
//
// Initialize WinSock
//
nRet = WSAStartup(wVersionRequested, &wsData);
printf("WSASTARTUP nret = %d\n",nRet);
sd = socket(AF_INET, SOCK_STREAM, 0);
printf("SOCKET = %ld\n",s);
saServer.sin_family=AF_INET;
saServer.sin_addr.s_addr = inet_addr("192.168.0.4");
saServer.sin_port=htons(80);
d = bind(s,(struct sockaddr*)&saServer,sizeof(saServer));
printf("BIND = %ld\n",d);
getchar();
}
=============================================================
|
|
|
|
|
try this:
memset((char *) &saServer, 0, sizeof(saServer));
saServer.sin_family=AF_INET;
saServer.sin_addr.s_addr = inet_addr("192.168.0.4");
saServer.sin_port=htons(80);
|
|
|
|
|
Hi guys.
I have a CListCtrl control in my application. I would to let one of its items be selected when the user click some buttons.
How can I do?
CListCtrl::SetHotItem doesn't work.
Hi guys. I'm a very fat man. Do you like fat men?
|
|
|
|
|
Use SetItem. mask = LVIF_STATE, state = LVIS_SELECTED;
|
|
|
|
|
I Developed a MFC dialog box,i want insert a flash file in the DialogBox, how can i do this ?
Any help...
Thank you.
|
|
|
|
|
Its simple.
I have done that for my screensaver.
Add Shockwave ActiveX control to your dialog by
Project->Add Components.
THen there in registered activeX components and then ShockWave ActiveX or watever u want.
Then put it in ur dialog and add a member variable to your activeX control.
Then use this code in ur app
<br />
m_flash.SetMovie(strFile);<br />
m_flash.Play();<br />
-----------------------------------------------------------
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
I write header file "ooo.h" and want to write this below text in ooo.h
#define X "123"
This below is some part of my code
************************************************
FILE *outp;
CString output_filename;
Output_filename = "ooo.h";
outp = fopen(output_filename, "w");
fprintf(outp, "#define X "123" ");
fprintf(outp, "\n");
if (output_filename)
{
fclose(outp);
}
************************************************
When I compile program there are 2 error messages happen cause by this line
fprintf(outp, "#define X "123" ");
I change that line to
fprintf(outp, "#define X 123");
So I can compile program and it write
#define X 123
but I want
#define X "123"
If you know how to solve my problem? Please tell me.
Thank you.
|
|
|
|
|
ooosawaddee3 wrote:
fprintf(outp, "#define X "123" ");
you need to escape some of these quotes:
fprintf( outp, "#define X \"123\" \n" );
try that...
Just trying to keep the forces of entropy at bay
|
|
|
|
|
use
\" in place of "
A Programmer Never Dies..***
|
|
|
|
|
I create a process(a console application), and after some operations, i need to terminate it. Now I use TerminateProcess() function, and it does work. But i'd rather like the process exit normally. So i need to send some keyboard messages('Esc' and 'n') first, then terminate it. How?
Thanks!
|
|
|
|
|
AttachThreadInput + SendInput
|
|
|
|
|
I have tried AttatchThreadInput() and keybd_event() instead, but they can't work properly.
keybd_event() does simulate a keyboard message, but only my thread received it, and the child process doesn't.
Can you give me some further advice?
|
|
|
|
|
Please explain exactly what you have done, and what you want to do. With this information I could answer "Scream and shout" and it would be an answer equally correct and incorrect.
|
|
|
|
|
Ok code first;
dll:
__declspec(dllexport) void AlstgPlug( void );
in exe:
typedef void (CALLBACK* MYFUNC)(void);
HINSTANCE hDLL = AfxLoadLibrary("FOUS21.dll");
if (hDLL)
{
FARPROC pnProc = GetProcAddress (hDLL, "AlstgPlug");
MYFUNC pnMyfunc = (MYFUNC)pnProc;
(pnMyfunc)();
FreeLibrary(hDLL);
}
It fails at the function call pnMyfunc(); It exits completely. If you need more info just ask. I am new to this so please don't assune I remembered some critical, or small step. Thanks in advance
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Darroll wrote:
(pnMyfunc)();
try:
(*pnMyfunc)();
Just trying to keep the forces of entropy at bay
|
|
|
|
|
RedZenBird wrote:
try:
(*pnMyfunc)();
It does not matter. You might write: pnMyFunc(). That's not the point. Remove CALLBACK specification since your function declared as __cdecl, whereas CALLBACK use __stdcall specification
|
|
|
|
|
just do by reference
A Programmer Never Dies...
|
|
|
|
|
I have a header-style list control with two columns. I'm wanting to put an image in the 2nd column (have already successfully put an image with text in the first column). Here's how I'm doing it:
PlayerListCtrl.SetItem(nItem,1,LVIF_IMAGE,0,2,0,0,i);
What am I doing wrong?
Thanks!
|
|
|
|
|
There is no standard way to assign image to any other column except first.
You must draw it manually. Use for this purpose a NM_CUSTOMDRAW notify event. CDDS_SUBITEM indicate a current drawing subitem column. For additional info see MSDN
|
|
|
|
|
|
Thanks, that's EXACTLY what I needed!
|
|
|
|