|
Is any way to accept messages from child window ==> parent windows for processing(translate message). And if message isnt WM_LBUTTONDOWN send message to child window. (child window never conceive WM_LBUTTONDOWN but user click on it - without WS_DISABLE)
Wiizi
|
|
|
|
|
Have a look at PreTranslateMessage, I think it will do what you are wanting.
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
You need to override the WindowProc function. Here's an example of doing that where I'm not allowing the OK button's normal processing to continue (by returning FALSE from the function).
if (message == WM_COMMAND && LOWORD(wParam) == IDOK)
{
TRACE("I got this click and I'm not allowing it to process!!");
return FALSE;
}
If I want the button to handle it's message, then I simply return the return value of the base class' WindowProc function:
return CDialog::WindowProc(message, wParam, lParam);
Also, you can use the hwnd of the control (I used the resource id) by referencing the lParam argument (instead of the low byte of the wParam).
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I worte a litte command line programm where i can access ReiserFS Partitions. Now i want add this capability to the explorer. So anyone knows if its possible to add for eg. a new drive in the explorer window...
Thanks
|
|
|
|
|
There are two approaches you can take. One is to write a device driver, which can be assigned a drive letter. The other is to write a namespace extension which can add a folder under My Computer (along side Control Panel). I have a tutorial on namespace extensions in the Shell section.
--Mike--
Buy me stuff!
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Thanks Michael. I made it now with namespace extensions, well its a good sollution but cause i have some time atm. (student i want try it with a device driver. Anyone have some ideas or links about device driver?
|
|
|
|
|
any one who can help me about dragndrop a bitmap in vc++
if anyone has any information regarding it, please mail me if u can, that would be a lot of help,
thanks in advance
Ashok Singh
<west end="" india="">
|
|
|
|
|
You need to be more specific about exactly what you're attempting to do.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Hi
Do you know how can I get array or supported properties of control at runtime ?
Wiizi
|
|
|
|
|
Hey all.
I use CreateWindowEx to create a Rich Edit Control. I use WS_EX_RIGHT | WS_EX_RTLREADING to make it right-aligned on a Hebrew OS.
It works well on Windows 2000, but on a clean installation of Win98 Heb-enabled, the content of the Rich Edit Control is left-aligned. On a not-so-clean installation of Win98 (which has Visual Studio, Office, etc.) - it displays correctly.
The problem is not with comctl32.dll - copying that file from the "good" win98 to the "bad" win98 doesn't solve it.
Any ideas??
|
|
|
|
|
|
I can't thank you enough!
That's the cause... Everything works great with Rich Edit Control 3, but not-so-great with version 2.
Do you have any idea WHY version 2 doesn't right-align correctly?
Thanks!
|
|
|
|
|
Hey,
Anybody know if it's possible to have two different "panes" in a console app. As in frames in a website... where you can have one frame with ceratin output [probably static] and the other frame will have different output.
Now taking suggestionsfor a new sig. please email me all suggestions.
|
|
|
|
|
I believe there is no direct support for console based panes. You'd have to simulate the whole thing with code and it may not be worth the effort.
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Your probably right. It mightn't be worth the effort.. but it would have been nice for the program I'm doing.
Now taking suggestionsfor a new sig. please email me all suggestions.
|
|
|
|
|
The Curses library allows multiple panels or "windows" in text terminal or console applications. There are commercial implementations of Curses for windows, and I suppose there's a port of the free ncurses library somewhere.
|
|
|
|
|
I would like to save the printer info in some variables so that the user can just press any button and volla. I want to code this myself into one of my controls. I also want to avoid doing a DoModal on CPrintDialog because this would stop my thread while the dialog is open. Also, I do not believe the dialog can do Modeless.
Can I save the HDC to the printer and its DevMode stuff to a member variable in my control without any problems? Will it interfere if there is another app and its uses the printer or another printer driver etc?
Appreciate any responses.
|
|
|
|
|
I have a heavy calculating function that runs on a machine with twelve processors. I have divided the calculation in 12 similair pieces to improve calculation. The calculation runs in 12 threads. The main calculation function starts 12 threads, one for each processor. I wish to send som parameters to the threads via the main calculation function. But a threadprocedure takes a pointer to void as argument. I must therefore send a pointer to a struct. But how can I preserve const for some of the arguments? const members of the struct doesnt work since the values are parameters to the function that starts the threads.
|
|
|
|
|
In the thread function why can't you have:
const MyStruct* pMyStruct = static_cast<mystruct*>( lpVoid );
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I'm not sure if this is what you're asking, but this example shows how you can define a struct with const references to some external variables:
struct calculation_parms
{
const int& parm;
calculation_parms(const int &parm):parm(parm){}
private:
calculation_parms(calculation_parms&);
calculation_parms& operator=(calculation_parms&);
}; Another issue having not to do with this is that, IMHO, Windows OSs do not distribute threads acrosss several CPUs (the distribution is done on a per-process basis). If I'm right, this scheme of yours won't help speed up the calculations (you'd have to launch 12 separate processes.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Wish: to have the paramter src to of the function threadedblurfilter const.
--START CODE EXAMPLE--
#include <stdio.h>
#define _REENTRANT
#include <pthread.h>
#include <math.h>
#include "blurfilter.h"
#include "ppmio.h"
typedef struct
{
int xsize;
int ysize;
pixel *src;
pixel *dst;
int radius;
double *weight;
int ystart;
int yend; /*blurfilter calculates including this coordinate.*/
} blurinfo_t;
void *blurfilter(void *);
void threadedblurfilter(const int xsize, const int ysize, pixel *src, pixel *dst
,
const int radius, double *weight, const int nthreads)
{
blurinfo_t *blurinfo = (blurinfo_t *)malloc(nthreads * sizeof(blurinfo_t));
pthread_t *threadId = (pthread_t *)malloc(nthreads * sizeof(pthread_t));
int i, j;
int npixelsperthread = ysize / nthreads;
int ypos = 0;
int breakreached = 0;
for (i = 0; i < nthreads; i++)
{
if ((double)(ysize - ypos) / (double)(nthreads - i) ==
(ysize - ypos) / (nthreads - i) &&
breakreached == 0)
{
breakreached = 1;
npixelsperthread++;
}
blurinfo[i].radius = radius;
blurinfo[i].weight = weight;
blurinfo[i].xsize = xsize;
blurinfo[i].ysize = ysize;
blurinfo[i].src = src;
blurinfo[i].dst = dst;
blurinfo[i].ystart = ypos;
blurinfo[i].yend = blurinfo[i].ystart + npixelsperthread - 1;
pthread_create(&threadId[i], NULL, blurfilter, &blurinfo[i]);
ypos += npixelsperthread;
}
for (j = 0; j < nthreads; j++)
{
pthread_join(threadId[j], NULL);
}
free(threadId);
}
void *blurfilter(void *p)
{
blurinfo_t *blurinfo = (blurinfo_t *)p;
//Lots of heavy calculations.
}
--END CODE EXAMPLE--
|
|
|
|
|
how can i change edit font color???
|
|
|
|
|
if u r using a DC to output u'r text, then u can change u'r font color by setting DC's SetTextColor property
Ashok Singh
<west end="" india="">
|
|
|
|
|
Use CDC::SetTextColor in CWnd::OnCtlColor . I think there are some good articles explaining this on CP.
Cheers
/moliate
|
|
|
|
|
//this is how i set the size and the ==== bold
//setting edit box yfont size
LogFont.lfHeight = 15;
LogFont.lfWeight = FW_BOLD;
newFont.CreateFontIndirect(&LogFont);
GetDlgItem(IDC_EDIT1)->SetFont(&newFont);
CEdit* smpEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
smpEdit->SetWindowText(afileName);
|
|
|
|