Upload
master
View
246
Download
0
Embed Size (px)
Citation preview
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 1/19
Re so ur c e s in Visua lRe so ur c e s in Visua lBa si c 6.0Ba si c 6.0K . N i t h e e s h M u r u g a n
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 2/19
Wha t i s a Re so ur c e ?Wha t i s a Re so ur c e ?
A r e s o u r c e i s a s u p p l y o f
r e q u i r e d i n f o r m a t i o n t op r o c e s s a f u n c t i o n / d a t a .
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 3/19
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 4/19
Wha t i s a Re so ur c e Fi l e ?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 images,
sounds, v id eos , data , or an y fil e s r eq 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 r c e f i l e s a r e R e a d - O n l y .
W h e n y o u c o m p i l e y o u r p r o j e c t , t h e
r e s o u r c e f i l e i s c o m p i l e d r i g h t i n t o t h e
. E X E , . D L L , . O CX , e t c . ,
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 5/19
Why Re so ur c e Fi l e ?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 f i l e s in t o a
r e s o u r c e f i l e◦ 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 t r a f i l e s
O rganiz ation
◦ m a k e s t h e m e a s y to f i n d
◦ m a k e s t h 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
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 6/19
Why Re so ur c e Fi l e ?Why Re so ur c e Fi l e ? S e curity
◦ I f y o u p u t d a t a f i l e s i n t o a r e s o u r c e f i l e , t h e y g e t
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 i f y o u h a v e i m a g e s t h a t y o u w a n t t o u s e , b u t
d o n ' t w a n t o t h e r s t o g a i n a c c e s s t o . . . p u t t i n g
t h e m i n t o y o u r p r o j 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 e s s t o t h e m b u t a t t h e s a m e t i m e h i d e s
th e m f r o m e v e r y o n e e l s e .
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 7/19
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 8/19
St a n da r d Re so ur c e s …St a n da r d Re so ur c e s … I c o n
Cu r s o r M e n u
D i a l o g B o x B i t m a p
E n h a n c e d M e t a f i l e
F o n t
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 9/19
Win Me ssa g e s a n dWin Me ssa g e s a n dD e v i c e C o n t e xt …D e v i c e C o n t e xt …
T h e b i g g e s t a d v a n t a g e o f W i n d o w s P r o g r a m m i n g
i s
◦ W i n d o w s M e s s a g e s
◦ D e v i c e Co n t e x t
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 10/19
Win Me ssa g e s a n dWin Me ssa g e s a n dD e v i c e C o n t e xt …D e v i c e C o n t e xt …
I n t e r a c t i o n b e t w e e n t h eU s e r a n d t h e S y s t e m i s
d o n e w i t h t h e h e l p o f
M e s s a g e s .
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 11/19
Win P r o g r a m m i n gWin P r o g r a m m i n g W i n d o w s P r o g r a m m i n g
i s W YS I W YG
M u l t i t h r e a d e d
M u l t i t a s k i n g
I n t e r a c t i o n
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 12/19
Win P r o g r a m m i n gWin P r o g r a m m i n gC o m p o n e n t sC o m p o n e n t s T h i s i s b a s e d o n
K e r n e l 32. d l l M e m o r y 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 I n t e r f a c e
W i n d o w i n g L o g i c
g d i . d l l 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
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 13/19
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 14/19
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 15/19
Win Me ssa g e sWin Me ssa g e sSt r uc t ur e …St r uc t ur e … T h e s y s t e m s e n d s a m e s s a g e t o a
w i n d o w p r o c e d u r e w i t h f o l l o w i n g
p a r a m e t e r s :
◦ a w i n d o w h a n d l e
◦ a m e s s a g e i d e n t i f i e r
◦
a n d t w o v a l u e s c a l l e d m e s s a g ep a r a m e t e r s .
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 16/19
Win Msg St r uc t ur eWin Msg St r uc t ur eWin do w Ha n dl eWin do w Ha n dl e
T h e w i n d o w h a n d l e i d e n t i f i e s t h e
w i n d o w f o r w h i c h t h e m e s s a g e i s
i n t e n d e d . T h e s y s t e m u s e s i t t o d e t e r m i n e w h i c h
w i n d o w p r o c e d u r e s h o u l d r e c e i v e t h e
m e s s a g e
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 17/19
Win Msg St r uc t ur eWin Msg St r uc t ur eMe ssa g e Ide n t i f i e rMe ssa g e Ide n t i f i e r
A m e s s a g e i d e n t i f i e r i s a n a m e d c o n s t a n t
t h a t i d e n t i f i e s t h e p u r p o s e o f a m e s s a g e .
W h e n a w i n d o w p r o c e d u r e r e c e i v e s am e s s a g e , i t u s e s a m e s s a g e i d e n t i f i e r t o
d e t e r m i n e h o w t o p r o c e s s t h e m e s s a g e .
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 18/19
Win Msg St r uc t ur eWin Msg St r uc t ur eMe ssa g e P a r a m e t e r s:Me ssa g e P a r a m e t e r s:
M e s s a g e p a r a m e t e r s s p e c i f y d a t a o r t h e
l o c a t i o n o f d a t a u s e d b y a w i n d o w
p r o c e d u r e w h e n p r o c e s s i n g a m e s s a g e . T h e m e a n i n g a n d v a l u e o f t h e m e s s a g e
p a r a m e t e r s d e p e n d o n t h e m e s s a g e .
A m e s s a g e p a r a m e t e r c a n c o n t a i n a n
int e g e r, p ack e d bit flags , a p oint e r to a structur econtaining additional data, a n d s o o n .
W h e n a m e s s a g e d o e s n o t u s e m e s s a g e
p a r a m e t e r s , t h e y a r e t y p i c a l l y s e t t o
N U L L .
8/6/2019 L4 Resources
http://slidepdf.com/reader/full/l4-resources 19/19
Win Msg St r uc t ur eWin Msg St r uc t ur eMe ssa g e t y p e sMe ssa g e t y p e s
S y s t e m - D e f i n e d M e s s a g e s :
◦ T h e s y s t e m s e n d s o r p o s t s a s y s t e m - d e f i n e d
m e s s a g e w h e n i t c o m m u n i c a t e s w i t h a na p p l i c a t i o n .
◦ I t 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 l i c a t i o n s a n d t o p r o v i d e i n p u t a n d o t h e r
in f o r m a t i o n f o r a p p l i c a t i o n s to p r o c e s s .
A p p l i c a t i o n - D e f i n e d M e s s a g e s :◦ A n a p p l i c a t i o n c a n c r e a t e m e s s a g e s t o b e u s e d
b y i t s o w n w i n d o w s o r t o c o m m u n i c a t e w i t h
w i n d o w s i n o t h e r p r o c e s s e s .
◦ I f a n a p p l i c a t i o n c r e a t e s i t s o w n m e s s a g e s , t h e
w i n d o w p r o c e d u r e t h a t r e c e i v e s t h e m m u s ti n t e r p r e t t h e m e s s a g e s a n d p r o v i d e a p p r o p r i a t e
p r o c e s s i n g .