Re so ur c e s i n Vi sua l Ba si c 6.

0
K . N ith e e s h M u ru g a n

Wha t i s a Re so ur c e ?
A res o urc e is a s u p ply of r eq u i r e d in f or m ati o n to p ro c e s s a fu n c tio n / d a ta .

Wha t i s a Re so ur c e ?
I n Vi s u a l B a s i c , a r e s o u r c e i s al s o c o nsidere d as a binar y data that can be adde d to the exec u table of a Wi n d o w s- b a s e d fil e a p p lic a tio n .

Wha t i s a Re so ur c e Fi l e ?
A R e s o u r c e F i l e i s a f i l e w h e r e imag es , sounds, v id eos , data, or an y fil es r e q u i r e d t o o p e r a t e t h e p r o je c t i s s t o r e d . R e s o u rc e file s a r e R e a d -O n ly. W hen y o u c o m p i l e y o u r p r oj e c t , t h e r e s o u r c e fil e is c o m p il e d ri g h t i nt o t h e . E X E , . D L L , . O CX , e t c . ,

Why Re so ur c e Fi l e ?
Consolidation
◦ P u t t i n g y o u r s u p p o r t / m u l t i m e d i a fi l e s in t o a re s o u r c e file ◦ N o N e e d o f u s i n g U s e r s Ha r d D r i v e f o r S t o r i n g e x tr a file s

O rganiz ation
◦ m a k e s th e m e a s y to f i n d ◦ m a k e s th e m e a s y to o r g a n i z e a n d r e t r i e v e

Why Re so ur c e Fi l e ?
S e curity
◦ If y o u p u t d at a files i n t o a r es o u r c e file, t h e y g et c o m p i l e d a n d c a n 't b e r e t r i e v e d e x t e r n a l l y ◦ O r if y o u h a v e i m a g e s that y o u w a nt to us e, b ut d o n 't w a n t ot h e r s t o g a i n a c c e s s t o... p u tti n g t h e m i n t o y o u r p r oj e c t i n a r e s o u r c e f i l e g i v e s y o u a c c es s t o th e m b ut at th e s a m e ti m e h id e s th e m fr o m e v e r y o n e e l s e .

Why Re so ur c e Fi l e ?
Sp eed
◦ It i s m u c h e a si e r a n d f a st e r r e s o u r c e w i t h i n y o u r p r o je c t to load fr o m a or

◦ w h e n y o u l o a d a c o m p i l e d fil e li k e a n . E X E .D L L . . . th e e n t i r e th i n g is lo a d e d in t o R A M .

◦ S o r etri e vi n g a file sto r e d i n a r es o u r c e w i t hi n th at . E X E , . D L L , etc. is a si m p l e m a tt e r of g r a b b i n g a p o i n t e r to it in R A M .

St a n da r d Re so ur c e s …
Ic o n Cu r s o r M enu D ia lo g B o x B itm a p E n h a n c e d M e ta file Font

Wi n Me ssa g e s a n d D e v i c e C o n t e xt …
T h e b ig g e s t a d v a n ta g e o f W in d o w s P ro g ra m m in g is
◦ W in d o w s M e s s a g e s ◦ D e v i c e Co n t e x t

Wi n Me ssa g e s a n d D e v i c e C o n t e xt …
In te r a c tio n b e tw e e n th e U s e r a n d th e S y s te m is d o n e w ith th e h e lp o f M essages.

Wi n P r o g r a m m i n g
W in d o w s P ro g ra m m in g is
W M M In YS I W YG u ltith re a d e d u ltita s k in g te ra c tio n

Wi n P r o g r a m m i n g C o m p o n e n ts
T h is is b a s e d o n
K e r n e l 32. d l l
M e m o ry M a n a g e m e n t F i l e I /O Ha n d l i n g

U s e r 32. d l l
U s e r In te rfa c e W in d o w in g L o g ic

g d i.d ll
T e x t Ha n d l i n g o n t h e s c r e e n G r a p h i c s Ha n d l i n g o n t h e s c r e e n

Wi n Me ssa g e s
M e s s a g e s are c o m m u n i c atio n s or sig n als fro m a n o p eratin g s y ste m to a p plic ati o n pr o gr a m s or vi c e versa or fro m a p plicatio n p r o g r a m s to th e u s e r.

Wi n Me ssa g e s
T h e s y s t e m p ass es in put to a window p roce dure i n t h e f o r m o f m e s s a g e s . M e s sa ges are g e n erated b y b oth th e s y s te m a n d a p p l ic a ti o n s . T h e s yste m g e n erates a m e ssa g e a t e a c h in p u t e v e n t A n a p plic atio n can gen erate m essages to direct its own w i n d o w s to perfor m tasks or to co m m u nicate w ith windo ws in o th e r a p p lic a tio n s .

Wi n Me ssa g e s St r uc t ur e …
T h e s yste m sen ds a m essa ge to a w i n d o w pr o c e d ure with follo w i n g p a ra m e te rs :
◦ a w in d o w h a n d le ◦ a m e s s a g e id e n ti f i e r ◦ and two p a ra m e te rs . values c alle d message

Wi n Msg St r uc t ur e
Wi n do w Ha n dl e
The wind o w windo w for in te n d e d . handle i d e ntifies the w h ich the message is

T h e s y s t e m u s e s it t o d e t e r m i n e w h i c h w i n d o w proced u re sho uld receive the m essage

Wi n Msg St r uc t ur e
Me ssa g e Ide n t i f i e r
A m e s s a g e id e ntifier is a n a m e d c o n sta nt th a t id e n t i f i e s th e p u r p o s e o f a m e s s a g e . W h e n a wi n d o w proce d ure receiv e s a m e s s a g e, it u s e s a m e s s a g e i d e ntifier t o d e t e r m i n e h o w to p r o c e s s th e m e s s a g e .

Wi n Msg St r uc t ur e
Me ssa g e P a r a m e t e r s:
M e ssa ge para m eters specify data or the lo c atio n of data used by a windo w p ro c e d u re w h e n p ro c e s s in g a m e s s a g e . T h e m e a ni n g a n d value of the m e ssa g e p a r a m e t e r s d e p e n d o n th e m e s s a g e . A m e ssa ge param eter can co ntain a n int eg er, p ack ed bit flags, a point er to a structur e containing additional data, a n d s o o n . W h e n a message does not use me ssage p ar a m et ers, the y are ty pic ally set to N U L L .

Wi n Msg St r uc t ur e
Me ssa g e t y p e s
S y s te m -D e fin e d M e s s a g e s :
◦ T h e s yste m sen d s or p osts a s yste m - d efin e d m essage when it c o m m u nicates with an a p p lic a tio n . ◦ It u s e s t h e s e m e s s a g e s t o c o n t r o l t h e o p e r a t i o n s o f a p p lic ati o n s a n d to p r o vi d e in p ut a n d ot h e r in f o r m a t i o n fo r a p p l i c a t i o n s to p r o c e s s .

A p p lic a tio n -D e fin e d M e s s a g e s :
◦ A n a p p lic ati o n c a n cre at e m e s s a g e s t o b e u s e d b y its o w n w i n d o w s or t o c o m m u n i c at e w i t h w i n d o w s in o t h e r p r o c e s s e s . ◦ If a n a p p li c ati o n c r e a t es its o w n m e s s a g e s, t h e windo w pr o c e d ur e th at rec ei v es th e m m u st int er pr et th e m e s s a g e s a n d pr o vi d e a p p r o p riat e p ro c e s s in g .

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.