Posts

Showing posts with the label hook

Contiune keyboard working while hooking

Contiune keyboard working while hooking I'm learning recently how to hook APIs and I started with keyboard calls. I set the hook with "SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, 0, 0);" and everything is working as i want but... Hooking is capturing keyboard and kinda blocking it - so as i want only to get informations that keys are used but dont wanna change the way they'r working i used "keybd_event(p->vkCode, 0, 0, 0);" and here appears another "but"... This function as it's simulation of key press it going to be hooked again what i do NOT want. Is there any solution to get information about keyboard using without blocking the work of it? WH_KEYBOARD_LL not blocking keyboard – RbMm Jun 29 at 9:06 WH_KEYBOARD_LL DO NOT call keybd_event() from inside th...

Drupal, hook_form_alter add field in node edit / create

Drupal, hook_form_alter add field in node edit / create I have a node and I need to populate a field programmatically, so here is what I do : $campaigns = $client->get_campaigns(); $tab_campaign = array(""=>"Dernière newsletter"); foreach ($campaigns->response as $camp){ $tab_campaign[$camp->CampaignID] = $camp->Name; } $form['field_last_newsletter'] = array( '#type' => 'select', '#required' => true, '#options' => $tab_campaign, '#title' => 'Choisir la dernière newsletter', ); } This work, I have my select field populated but when I select one and click on save nothing is saved, if I come back to the edit page the select have the default value, what I am doing wrong ? Thanks. 2 Answers 2 I think you're looking for a allowed_values_function s...