can't send GdkEventKey to notepad++?



Hi,folks!

I'm tring to write a program to send GdkEventKey to other program on
windows,such as notepad++.
and following is my code:

HWND hwnd;

void key_press(GtkWidget *widget,GdkEventKey *event,gpointer data){

    g_print("%d %d %d %d %d %s
\n",event->send_event,event->time,event->state,
            event->keyval,event->length,event->string);
    gdk_event_send_client_message((GdkEvent *)event,hwnd);

}

int main(int argc,char *argv[]){

...

    hwnd = FindWindow(NULL,"new  1 - Notepad++");
    if(hwnd!=0){
        MoveWindow(hwnd,0,0,500,500,TRUE);
        g_print("%d\n%s\n",hwnd,buffer);
    }else
        g_print("failure\n");

...

g_signal_connect(window,"key_press_event",G_CALLBACK(key_press),NULL);

...
}



After running this program,I can see that the MoveWindow() works.But
everytime I pressed a key,the same warning appeared:
Gdk-WARNING **:Only four bytes of data are passed in client messages on
Win32.

( there isn't anything in notepad++ editor.)

What should I do to solve this problem?
Any suggestion is appreciated!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]