Wednesday, March 18, 2020

The Joys of Motherhood essays

The Joys of Motherhood essays In Buchi Emechetas The Joys of Motherhood novel, the main character, Nnu Ego shows what it means to be a woman and a mother in Nigerian society. Also, Emecheta explores the idea that women having the ability to bear children are the only way to define femininity and womanhood in the novel. However, The Joys of Motherhood plays two important roles to the women at that time. First, even though society is changing, some women are still maintaining the traditional roles, the customs and the values in the Lagos City. At the same time they defeated the standards of feminist theory. Secondly, the novel gives an understanding of some of the aspects of the feminist theory and encourages women to achieve social equality among men and women. However, men still dominated women during that time. Nnu Ego is one of the women who had been trying to be traditional in a modern urban setting (81). In The Joys of Motherhood, she plays many general roles - as a daughter, a wife, a mother, a woman, a worker and a senior wife. As a daughter of Nigerian Chief, Nwokocha Agbadi, Nnu Ego always listens to her fathers disposition and she never opposes him. Therefore, she agrees to marry the man whom her father has chosen for her. After she is married to her first husband, Amatokwu, she wants to be a good wife, which means that she is able to conceive a child with him. However, the first marriage failed because she did not bear him a son (49). In the traditional society, if the married woman is not able to bear children and offer her husband a son, she is considered a failure and has failed to fulfill her gender role as a wife. She will also bring disgrace not only to her husband but also to her father. Her first marriage, Nnu Ego has condemned herself as a failed woman. Later she married a man, Nanife, who works on the coast in a British colony. She is able to bear children with her second husb...

Monday, March 2, 2020

Use Windows Hooks in Delphi Applications

Use Windows Hooks in Delphi Applications Code submitted by Jens Borrisholt. Text by Zarko Gajic. By Jens: Hooks, I’ve seen a lot of people trying to make a clean solution for hooking messages in an application. So I decided some time ago to implement hooks as a class, with nice events and stuff :) Hook.pas makes it possible to assign a method pointer to a procedure pointer (with some help from assembler). For example: if you want to trap ALL keystrokes in your application - simply declare an instance of TKeyboardHook, assign an event handler for OnPreExecute or OnPostExecute, or both. Set you KeyboadHook active (KeyboardHook.Active : True) and you are out and running .. On Windows Hooks A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure. Put shortly, a hook is a function you can create as part of a dll or your application to monitor the goings on inside the Windows operating system. The idea is to write a function that is called every time a certain event in windows occurs - for example when a user presses a key on the keyboard or moves the mouse. For a more in depth introduction to hooks, take a look at What Windows hooks are and how to use them within a Delphi application. Hooking mechanism relies on Windows messages and callback functions. Types of Hooks For example:You can use the WH_KEYBOARD hook to monitor keyboard input posted to a message queue;You can use the WH_MOUSE hook to monitor mouse input posted to a message queue;You can a WH_SHELL hook procedure when the shell application is about to be activated and when a top-level window is created or destroyed. Hooks.pas TCBTHook - called before activating, creating, destroying, minimizing, maximizing, moving, or sizing a window; before completing a system command; before removing a mouse or keyboard event from the system message queue; before setting the input focus; or before synchronizing with the system message queue.TDebugHook - called before calling hook procedures associated with any other hook in the systemTGetMessageHook - enables an application to monitor messages about to be returned by the GetMessage or PeekMessage functionTJournalPlaybackHook - enables an application to insert messages into the system message queue.TJournalRecordHook - enables you to monitor and record input events (to record a sequence of mouse and keyboard events to play back later by using the WH_JOURNALPLAYBACK Hook).TKeyboardHook - enables an application to monitor message traffic for WM_KEYDOWN and WM_KEYUP messages.TMouseHook - enables you to monitor mouse messages about to be returned by the GetMessage or PeekMes sage function. TLowLevelKeyboardHook - enables you to monitor keyboard input events about to be posted in a thread input queue.TLowLevelMouseHook - enables you to monitor mouse input events about to be posted in a thread input queue. TKeyboardHook example Download hooks.pas demo application uses hooks, .... var   Ã‚  KeyboardHook: TKeyboardHook; .... //MainForms OnCreate event handler procedure TMainForm.FormCreate(Sender: TObject) ; begin   Ã‚  KeyboardHook : TKeyboardHook.Create;   Ã‚  KeyboardHook.OnPreExecute : KeyboardHookPREExecute;   Ã‚  KeyboardHook.Active : True; end; //handles KeyboardHooks OnPREExecute procedure TMainForm.KeyboardHookPREExecute(Hook: THook; var Hookmsg: THookMsg) ; var   Ã‚  Key: Word; begin   Ã‚  //Here you can choose if you want to return   Ã‚  //the key stroke to the application or not   Ã‚  Hookmsg.Result : IfThen(cbEatKeyStrokes.Checked, 1, 0) ;   Ã‚  Key : Hookmsg.WPARAM;   Ã‚  Caption : Char(key) ; end; Ready, set, hook :)