Sunday, October 24, 2010

Compilation of various source - break


title Control-Break handler for Lattice C programs
name break
include dos.mac

;
; Control-Break Interrupt Handler for Lattice C programs
; Running on IBM PCs (and ROM BIOS compatibles)
;
; Ray Duncan, May 1985
;
; This module allows C programs running on the IBM PC
; To retain control when the user enters a Control-Break
; Or Control-C. This is accomplished by taking over the
; Int 23H (MS-DOS Control-Break) and Int 1BH (IBM PC
; ROM BIOS Keyboard Driver Control-Break) interrupt
; Vectors. The interrupt handler sets an internal
; Flag (which must be declared STATIC INT) to TRUE within
; The C program; the C program can poll or ignore this
; Flag as it wishes.
;
; The module follows the Lattice C parameter passing
; Conventions, and also relies on the Lattice file DOS.MAC
; For the definition of certain constants and macros.
;
; The Int 23H Control-Break handler is a function of MS-DOS
; And is present on all MS-DOS machines, however, the Int 1BH
; Handler is a function of the IBM PC ROM BIOS and will not
; Necessarily be present on other machines.
;
if lprog
args equ 6; offset of arguments, Large models
else
args聽聽聽 equ聽聽聽聽 4聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;offset of arguments, Small models
聽聽聽聽聽聽聽 endif

cr equ 0dh; ASCII carriage return
lf equ 0ah; ASCII line feed

聽聽聽聽聽聽聽 pseg

聽聽聽聽聽聽聽 public聽 capture,release ;function names for C

;
; The function CAPTURE is called by the C program to
; take over the MS-DOS and keyboard driver Control-
; Break interrupts (1BH and 23H).聽 It is passed the
; address of a flag within the C program which is set
; to TRUE whenever a Control-Break or Control-C
; is detected.聽 The function is used in the form:
;
;聽聽聽聽聽聽聽聽聽聽聽聽聽聽 static int flag;
;聽聽聽聽聽聽聽聽聽聽聽聽聽聽 capture(&flag)
;

capture proc聽聽聽 near聽聽聽聽聽聽聽聽聽聽聽 ;take over Control-Break

聽聽聽聽聽聽聽 push聽聽聽 bp聽聽聽聽聽聽聽聽聽聽聽聽聽 ;interrupt vectors
聽聽聽聽聽聽聽 mov聽聽聽聽 bp,sp
聽聽聽聽聽聽聽 push聽聽聽 ds

聽聽聽聽聽聽聽 mov聽聽聽聽 ax,word ptr [bp+args]
聽聽聽聽聽聽聽 mov聽聽聽聽 cs:flag,ax聽聽聽聽聽 ;save address of integer
聽聽聽聽聽聽聽 mov聽聽聽聽 cs:flag+2,ds聽聽聽 ;flag variable in C program

聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;pick up original vector contents
聽聽聽聽聽聽聽 mov聽聽聽聽 ax,3523h聽聽聽聽聽聽聽 ;for interrupt 23H (MS-DOS
聽聽聽聽聽聽聽 int聽聽聽聽 21h聽聽聽聽聽聽聽聽聽聽聽聽 ;Control-Break handler)
聽聽聽聽聽聽聽 mov聽聽聽聽 cs:int23,bx
聽聽聽聽聽聽聽 mov聽聽聽聽 cs:int23+2,es

聽聽聽聽聽聽聽 mov聽聽聽聽 ax,351bh聽聽聽聽聽聽聽 ;and interrupt 1BH
聽聽聽聽聽聽聽 int聽聽聽聽 21h聽聽聽聽聽聽聽聽聽聽聽聽 ;(IBM PC ROM BIOS keyboard driver
聽聽聽聽聽聽聽 mov聽聽聽聽 cs:int1b,bx聽聽聽聽 ;Control-Break interrupt handler)
聽聽聽聽聽聽聽 mov聽聽聽聽 cs:int1b+2,es

聽聽聽聽聽聽聽 push聽聽聽 cs聽聽聽聽聽聽聽聽聽聽聽聽聽 ;set address of new handler聽聽聽聽
聽聽聽聽聽聽聽 pop聽聽聽聽 ds
聽聽聽聽聽聽聽 mov聽聽聽聽 dx,offset ctrlbrk
聽聽聽聽聽聽聽 mov聽聽聽聽 ax,02523H聽聽聽聽聽聽 ;for interrupt 23H
int 21h
聽聽聽聽聽聽聽 mov聽聽聽聽 ax,0251bH聽聽聽聽聽聽 ;and interrupt 1BH
int 21h

聽聽聽聽聽聽聽 pop聽聽聽聽 ds聽聽聽聽聽聽聽聽聽聽聽聽聽 ;restore registers and
聽聽聽聽聽聽聽 pop聽聽聽聽 bp聽聽聽聽聽聽聽聽聽聽聽聽聽 ;return to C program
ret

capture endp


;
; The function RELEASE is called by the C program to
; return the MS-DOS and keyboard driver Control-Break
; interrupt vectors to their original state.聽 Int 23h is
; also automatically restored by MS-DOS upon the termination
; of a process, however, calling RELEASE allows the C
; program to restore the default action of a Control-C
; without terminating.聽 The function is used in the form:
;
;聽聽聽聽聽聽聽聽聽聽聽聽聽聽 release()
;

release proc聽聽聽 near聽聽聽聽聽聽聽聽聽聽聽 ;restore Control-Break interrupt
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;vectors to their original state聽聽聽聽聽聽聽
聽聽聽聽聽聽聽 push聽聽聽 bp
聽聽聽聽聽聽聽 mov聽聽聽聽 bp,sp
聽聽聽聽聽聽聽 push聽聽聽 ds

聽聽聽聽聽聽聽 mov聽聽聽聽 dx,cs:int1b聽聽聽聽 ;set interrupt 1BH
聽聽聽聽聽聽聽 mov聽聽聽聽 ds,cs:int1b+2聽聽 ;(MS-DOS Control-Break
聽聽聽聽聽聽聽 mov聽聽聽聽 ax,251bh聽聽聽聽聽聽聽 ;interrupt handler)聽聽聽聽
int 21h

聽聽聽聽聽聽聽 mov聽聽聽聽 dx,cs:int23聽聽聽聽 ;set interrupt 23H
聽聽聽聽聽聽聽 mov聽聽聽聽 ds,cs:int23+2聽聽 ;(IBM PC ROM BIOS keyboard driver
聽聽聽聽聽聽聽 mov聽聽聽聽 ax,2523h聽聽聽聽聽聽聽 ;Control-Break interrupt handler)
int 21h

聽聽聽聽聽聽聽 pop聽聽聽聽 ds聽聽聽聽聽聽聽聽聽聽聽聽聽 ;restore registers and
聽聽聽聽聽聽聽 pop聽聽聽聽 bp聽聽聽聽聽聽聽聽聽聽聽聽聽 ;return to C program
ret

release endp

;
; This is the actual interrupt handler which is called by
; the ROM BIOS keyboard driver or by MS-DOS when a Control-C
; or Control-Break is detected.聽 Since the interrupt handler
; may be called asynchronously by the keyboard driver, it
; is severely restricted in what it may do without crashing
; the system (e.g. no calls on DOS allowed).聽 In this
; version, it simply sets a flag within the C program to
; TRUE to indicate that a Control-C or Control-Break has
; been detected; the address of this flag was passed
; by the C program during the call to the CAPTURE function.
;

ctrlbrk proc聽聽聽 far聽聽聽聽聽聽聽聽聽聽聽聽 ;Control-Break interrupt handler

聽聽聽聽聽聽聽 push聽聽聽 bx聽聽聽聽聽聽聽聽聽聽聽聽聽 ;save affected registers
聽聽聽聽聽聽聽 push聽聽聽 ds

聽聽聽聽聽聽聽 mov聽聽聽聽 bx,cs:flag聽聽聽聽聽 ;set flag within C program
聽聽聽聽聽聽聽 mov聽聽聽聽 ds,cs:flag+2聽聽聽 ;to "True"
聽聽聽聽聽聽聽 mov聽聽聽聽 word ptr ds:[bx],-1

聽聽聽聽聽聽聽 pop聽聽聽聽 ds聽聽聽聽聽聽聽聽聽聽聽聽聽 ;restore registers and exit
聽聽聽聽聽聽聽 pop聽聽聽聽 bx

聽聽聽聽聽聽聽 iret

ctrlbrk endp


flag聽聽聽 dw聽聽聽聽聽 0,0聽聽聽聽聽聽聽聽聽聽聽聽 ;long address of C program''s
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;Control-Break detected flag

int23聽聽 dw聽聽聽聽聽 0,0聽聽聽聽聽聽聽聽聽聽聽聽 ;original contents of MS-DOS
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;Control-Break Interrupt 23H
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;vector

int1b聽聽 dw聽聽聽聽聽 0,0聽聽聽聽聽聽聽聽聽聽聽聽 ;original contents of ROM BIOS
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;keyboard driver Control-Break
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ;Interrupt 1BH vector


聽聽聽聽聽聽聽 endps

end






相关链接:



Report Download Managers



Photoshop SAVE Format



Longhorn Beta1 Only Compatible With Two Kinds Of Graphics Chips



Tencent no winner already had three incidents



Dell CEO Or After Class Due To Financial Scandals



excel in all TYPES of data input methods and



Guiyang Information Industry Bureau of his party visited the headquarters of King Abacus



Baidu will increase the proportion into win-win situation with the station



MP4 to FLV



TOD to WMV



MOV to iPod



Easy TO use Browsers



Production activities yourself menu bar



Feeling so Steady and VB API (1)



Shop Seasonal - Screen Savers



Wednesday, October 13, 2010

3G is not a cover


With several major 3G operator's specific position on the Chinese 3G start-up idea has become increasingly clear, up to now, China has already launched 3G into the basic facts, then we need to explore is how a previous law, how to send license , operators on how the layout.

In fact, the topic of the 3G I have talked a lot, and the reason turned out one more time again, is to see a lot of comments recently out of which more representative is: According to China Mobile's 3G development ideas, even if its to build TD-SCDMA network equipment vendors may be difficult to get short-term relatively large income; In addition, some people think that China Mobile has recently launched upgrade EDGE and TD may have conflicts.

For these remarks, I would like on to the next one of my basic viewpoints: from the present perspective, skip the 3G De Xiang Fa yes impossible, WiMax 绛?technology is difficult to enter the market short-term Huan mainstream, Gang Gang I am in a blog 涓?Yijingxiangxi expounded on this point, 4G technologies such as standardization is not clear, but industrialization is take a long time, in this based on the 3G launch has become inevitable.

In addition, I would like to stress that the input is on the 3G, this is equipment manufacturers are most concerned about the global 3G long-term slump, a large number of major equipment manufacturers have invested in 3G at a lot of money, after the update has made the rapid 3G equipment manufacturers must continue to invest, which is able to eventually recover input costs, the only way to 3G, so in the evolution of 3G technology, the equipment manufacturers to upgrade to a passive race.

Recently, China Mobile boss Wang on the 2G network to rely on local building 3G networks think so many people worried, 3G investment in the end is there? I think this is not necessary to worry about, according to Wang's idea, through the transformation of 2G 3G core network to achieve a shared purpose and, in fact, this attitude is one thing to be happy, description, led by China Mobile China 3G war is likely to be staged in advance, while in the long ago, China Mobile is also non-public Xing said it would consider upgrading nationwide EDGE, equipment manufacturers from this progressive strategy to move benefit, because the quick success of the entire pie is no good 3G, 3G pie made the larger, individual cake higher interest.

In addition, there is no escaping the fact that, at present it from the network construction cost, there is a polarization of the situation, it is said very little, a few hundred million people say a lot, to hundreds of billions. In fact, these figures are correct, the key to it is not at once put into the. Network construction costs from the point of view, including two wireless networks and most of the core network, including wireless network investment in basic accounting for about 75%, even if the 2G operators to transform the core network and location, resources, and a large number of inputs is also necessary .

From the above, I think that China's 3G is not a cover, it is hard cash to prop up the market, hold and cultivate the market demand will benefit operators, equipment manufacturers will be assigned to the of that one. But, the 3G, should also include a 2.5G, 2.75G and 3G market after.

Data from the current Chinese market demands, large market demand for 3G has not formed, 3G licensing policy has not yet enacted, in this case, before the development of 3G technology will be the main force, and in possession of a very long time substantial part of the share, such as moving from GPRS to EDGE in the transition; the former is bound to promote the development of 3G, 3G directness back forward, but you can not deny that they are 3G.

A month ago, I wrote a chapter blog: 3G narrowly on the interests of China telecommunications market, now look, this line of thinking is the need of our operators and equipment manufacturers to think carefully, and only a narrow 3G excluding simple argument, a comprehensive understanding of 3G meaning, can be better to guide and nurture the market may be in a very long period of time, we do not find the killer application of 3G.






相关链接:



Collective Wisdom light green hope



SARFT Responded: "shield Acronym" Department Of Misunderstanding



Command & Conquer 3 - the most difficult opponents experience



Nine Ways to recruit good staff



Comment Covert Surveillance



Myself A Good Looking Word Text Box



Bangalore, Dalian, China-style Heavy Road Test



TOD Converter



Job On The Road A Few Lessons To Remember



for you Download Managers



XviD to iPhone



Jsp custom tag in depth FROM shallow to explain in detail



The NUMBER of SLM earnings



Perfect Songs I Enjoy The Cool Music Box Full Support Win7



introduction AD Blockers



3GPP to WMV



Saturday, October 9, 2010

Customer is not his wife is a lover of God is



Customers are wives, need we can really operate, required to achieve life-long service. Customer is not just customer transactions occurred, including the potential development of the customer. For the latter, we have to careful management, that should be the same as the lover in hot pursuit, so I think the customers are his wife, need life-long service, and potential customers, they have to like Valentine's, requires hot pursuit!

Treatment of customers, we usually deal depending on whether he happened into two categories, namely, customers (closing) and potential customers (not traded). Turnover value of customers based on their own are divided into small, medium, large, VIP customers; no transaction sales transactions according to the possibility of customers, divided into A, B, C, D four grades.

Customers are his wife, need life-long service, and why?

Because often men and women after marriage, marriage will remain for some time. Maybe 2-3 years, both sides lost their passion and vitality for life, merely to maintain, and perhaps it is for kids. At this point, if you do not operate her, and usually there will be a number of complaints, grievances, nagging, complain, or even for each other, having an affair and so on. You have Haikudanlan between, eachother, life service will be gone. If you do not check and do not reflect, not aware, the service is always at a standstill, never hesitate, never creative. You will only make one lose out, lose power, results of your customers will really separate.

So, as customers like the wife, if you treat the customer is always static, content and form is almost no difference, let alone to help customers create value, generate new opportunities, let her and you build relationships with high loyalty , also just maintain the status quo, very easy to incite defection of your competitors.

Even if she does not leave you, you will not develop his values, or even a loss. For enterprises, the value is not particularly large. This customer loyalty is not even very concerned about your customers.

Potential customers, like lovers, need to chase the plane, why?

Because the potential customers for each company are looking forward to the development, while the two major potential customers is not a measure of business strength of protection. Development of potential customers the most important purpose is to let her be your real customers, which hope to become your life-long lover of his wife. But the deal lover, you can not see a simple chat will be your wife. You need to give your lover the performance of the stage, let her have a little favor for you, hand in hand chance to own their love is, and finally walked down the red carpet, into the wedding hall. This four-step needs at least the middle of the development. Similarly, treatment of lovers, according to the closeness of her relationship with you to determine the possibility of its development, which is necessary, but also in the process of service need to continue to serve, to provide a feat she was very surprised, very exciting time activities, a happy honeymoon and so on.鍙湁涓嶆柇鍒涢?鏂般?濂囥?鐗圭殑涓滆タ锛屾墠浼氭劅鍒颁綘涓庡叾浠栦汉涓嶄竴鏍凤紝鍚﹀垯浣犺儨绠楃殑鏈虹巼杈冨皬銆傚洜涓哄ス涓嶅儚鑰佸﹩锛屽ぉ缁忓湴涔夛紝娉曞緥瑙勫畾锛屼綘鑷冲皯涓?鏃堕棿鍙互楂樻灂鏃犲咖锛岀劧鑰屾儏浜轰笉琛岋紝鍙湁绱х揣鍦版姄浣忎竴娆℃満浼氾紝鐢ㄥ績鍦颁负鍏舵湇鍔★紝鐪熷績鍦板叧蹇冨ス锛屾墠浼氭湁鍙兘鎴愪负鑰佸﹩銆?br />
銆??鎵?互锛屾綔鍦ㄩ【瀹㈠儚鎯呬汉锛岀揣杩戒笉鑸?

銆??鏂囧姏鍐?瀹炴垬钀ラ攢涓撳;缁堢寤鸿绠$悊閿?敭涓撳;缁堢鍥㈣喘涓撳;鍥介檯鑱屼笟鍩硅甯堣涓氬崗浼氫笁鏄熷煿璁笀;缇庡浗ICQAC鍥介檯鑱屼笟鍩硅甯堛?澶氬鍩硅鍜ㄨ鏈烘瀯鐗硅仒鍏艰亴鍩硅璁插笀;涓浗鍩硅澶ц仈鐩熴?鍥介檯鑱屼笟鍩硅甯堣涓氫細鍛樸?涓浗鎬昏鍩硅浼氬憳......锛屾湁7骞寸粓绔攢鍞粡楠?浜斿勾涓氫綑鍩硅缁忓巻;







相关链接:



mfc80u dll was Not found error fix it safely



Dell amended financial statements over THE past four years, net profit is expected to cut 150 millio



Chip PC industry suppliers and the Evolution of two-man



Health And Nutrition for you



Reviews Covert Surveillance



DivX to MPEG



MP4 to 3G2



Official Contract Killer 3 Cheats



PPT To Teach You To Easily Modify The Colors In The Clip Art



A domestic room, map description IDC



21st Century Business Herald: reversal eBay



18th "Gold-collar workplace," Senior Human Resources Fair



FLV to VOB



Tuesday, September 28, 2010

Opened a pack of genuine secret behind the Win 7



November 12 message, Microsoft Windows 7 operating system in China has been officially sold more than half, Artesyn Technologies noted that some people are online and offline sales with a discount price of genuine Windows 7 activation code. Normal retail price of 2,460 yuan for Win 7 Ultimate activation code can be purchased for just 250, this activation can be activated by phone or Internet, except for telephone services is not Microsoft, its function is fully consistent with the retail version.

Low activation code from Microsoft's Developer Network

Artesyn Technologies has a number of visits to this ultra-cheap Win 7 activation code of the dealer, finally learned that these low-cost all genuine Win 7 activation key official from Microsoft MSDN (Microsoft Developer Network), and these low activation of the sale price more than those who paid for the MSDN subscription account owner.

According to the provisions of Microsoft's MSDN, in the payment of a subscription fee, MSDN subscription caught free access to multiple Microsoft products and related ISO image activation.

To Microsoft's MSDN Universal Edition account, for example, you can download all the products Microsoft ISO CD image, and get all the genuine product activation (including activation of 10 retail, Enterprise Edition, Version activation key large customers each one). It is reported that the activation code through the MSDN apply to commodities consistent with the retail version can be upgraded properly activate and enjoy the follow-up, the only difference is that the phone can not get Microsoft's support services.

An interest off the chain behind Windows 7

As early as 8 week, Microsoft online cheap in tracing the source of the serial number had already noticed MSDN subscribers, but only dared to express low activation "may come from MSDN subscribers," not as conclusive. It seems as normal, MSDN subscribers need to pay high fees, these subscribers can not provide a sufficient number of activation in support of long-term sale.

MSDN Universal edition still accounts for example, the market price of more than 30,000 yuan, the use of such accounts for 10 Win 7 Ultimate activation code and a sale is clearly worth the discount, but Artesyn Technologies understand that many people are relying on the business made a fortune, seemingly unprofitable a break already behind Win 7 with a sound chain of interest.

Artesyn Technologies, a willingness to accept the activation key sales staff interviewed said, Windows 7 aimed at individual users of such activation is not their main business, product activation key for enterprise customers is the key profit.

"Many SMEs have the office software and server and desktop operating system needs, these companies generally do not have special software procurement plans and personnel, they are long-term users of pirated. Genuine price they are hard to accept, but also worried about experience related litigation, they will usually do the procurement of genuine spare sets, we can price shipping genuine Folding them, this is our main source of profits; followed by a variety of Microsoft development software and Microsoft-specific software, shipments of such products volume is small, but great profits; Vista and Win 7 to individuals to buy such products can not bring a lot of profits, so take a quantity of a ship just off. "

"An account though expensive, but if caught SME users, enough to make on a small, Win 7 when earned pocket money on such products has."

On the supply problem, he said: "Many large companies have their own MSDN account, but the company will only use one of several Microsoft products, we are the company's software with these buyers are very familiar with it from them received a number of activation code, if necessary, as long as not too exaggerated amount we can meet. "

Activation is difficult to define low-cost illegal

Artesyn Technologies realize that the use of MSDN sales very difficult to define the behavior of low activation is illegal, a legal worker, said that sales activities and sales of pirated different, although it may be in violation of Microsoft and the MSDN subscription agreement between the , but it is difficult to give accurate to judge from the judicial point of view. "The biggest risks may be Microsoft's restrictions on the related products."

Win 7 is not a shock off the regular retail version of Win 7 of the market, more consumers preconceived activation of these low-cost sales were classified as liars go, these low-cost sales were not willing to activation caused by too much about Microsoft's attention .

In interviews, several low-cost activation key buyers of such products, said the reasons for their choice or price, cheap genuine activation key balance of such consumer awareness and purchasing power of the huge gap between.

"Without such a low price of genuine, I cracked version is expected to choose to deal with what", who had just bought a pack Win 7 Ultimate consumer says.







Recommended links:



Tissot wave through the "Dakar"



MPEG TO 3GPP



ping command usage



Is cloud computing business or wound machine



Gtalk and Skype will interact



MP4 to Flash



Components And Libraries Specialist



How To Fake Brand-name Motherboard Identification



Across threads in C # Winform Control access



Fireworks in the fade in animation production



S1500 Entry-level disk array read is cost-effective



Compare Personal Interest



FAQ: the difficult cases to solve Foobar



Easy Security And Privacy:



Tencent no winner already had three incidents



MKV to XBOX 360



Sunday, September 19, 2010

Initial bitmap


In this lesson we will learn how to use bitmap in the program. More precisely, we have to learn is how the client area of a window to display the bitmap.
Theory
Bitmap is stored in a computer in the picture. A considerable number of bitmap file format (Translation: If. BMP.JPG.GIF.PIC, etc.), but Windows only supports Windows Bitmap Graphics Format, or BMP file. This course is also referred to bitmap BMP files. Use bitmap easiest way is to define it in the resource file (. Rc) in the. There are two methods defined. The first method is to macro it is defined as an integer, as follows:

# Define IDB_MYB99vMAP 100
IDB_MYB99vMAP B99vMAP "c: projectexample.bmp"
The first line we define an integer with a value of 100 macros. The second line we have to point this macro to be defined integer bitmap, so the compiler will know where the path of the bitmap.
Another method is to give it a name, that is, it is defined as a string, as follows:
MyBitMap B99vMAP "c: projectexample.bmp"
Effects of two methods is the same. Choose a method, depending on the program you like to use integer or string to point to Macro bitmap.
Now that we have the bitmap defined in the resource file, the next step is to make it appear in the window client area.
In the process, we use the API function to obtain the bitmap handle LoadBitmap. Here is the complete LoadBitmap function type:
LoadBitmap proto hInstance: HINSTANCE, lpBitmapName: LPSTR

The function returns a bitmap handle. Function has two parameters, which is the process handle hInstance. lpBitmapName is a pointer to a bitmap name (for the second definition of method). If you use the first definition of method, you can fill point or integer values of a bitmap macro (this value corresponds to the example above is 100, an integer macro is IDB_MYB99vMAP). Here is a simple example:


The first method:
.386
. Model flat, stdcall
................
. Const
IDB_MYB99vMAP equ 100
...............
. Data?
hInstance dd?
..............
. Code
.............
invoke GetModuleHandle, NULL
mov hInstance, eax
............
invoke LoadBitmap, hInstance, IDB_MYB99vMAP
...........

The second method:

.386
. Model flat, stdcall
................
. Data
BitmapName db "MyBitMap", 0
...............
. Data?
hInstance dd?
..............
. Code
.............
invoke GetModuleHandle, NULL
mov hInstance, eax
............
invoke LoadBitmap, hInstance, addr BitmapName
...........

Text access to a device (DC) handle. You can respond to WM_PAINT message received through the API function BeginPaint. If the other message, you can use the API function GetDC access.
Create the memory DC image. The aim is to establish a "hidden drawing paper", the bit map "painted" on it, for buffer purposes. After the completion of this work, we adopted a function of "drawing paper" on the bitmap copy of the real DC. This is quickly displayed on the screen image of the double-buffering technique. (Translation: You can reduce image jitter) this "drawing paper," with the API function CreateCompatibleDC established, following the completion of its type:
CreateCompatibleDC proto hdc: HDC

If the function succeeds, will return to DC memory image that is "drawing paper," the handle.

Now we have the "drawing paper," could place a picture on it. SelectObject API function that can be completed, the first parameter is the "drawing paper," the handle, the second parameter is a bitmap handle, here is the function of the complete type:
SelectObject proto hdc: HDC, hGdiObject: DWORD
Now the bitmap has been drawn in the "drawing paper" has gone. Next we want to copy the bitmap in the real DC. There are many API functions can finish the job, such as BitBlt and StretchBlt. Function BitBlt the contents of only one DC to another DC simply copy, while the function is to automatically adjust StretchBlt copy the contents of the size of the source DC has the purpose to adapt the size of DC's output area, so the former than the latter faster. Here, we only use the function BitBlt, following the completion of its type:
BitBlt proto hdcDest: DWORD, nxDest: DWORD, nyDest: DWORD, nWidth: DWORD, nHeight: DWORD, hdcSrc: DWORD, nxSrc: DWORD, nySrc: DWORD, dwROP: DWORD

hdcDest purpose DC handle.
nxDest, nyDest purpose DC output area of the upper-left corner coordinates.
nWidth, nHeight purpose DC output area length and width.
hdcSrc handle of the source DC.
nxSrc, nySrc source DC in the upper left corner coordinates of area to be copied.
dwROP screen surface computing code (ROP). Copy the contents of the parameter used to determine the color and the color of the original output area by which computing approach. Usually, simply copy the contents of the output area with a overwrite.
All completed, the API function with the release of the bitmap DeleteObject object, that is, the bit map "erase."
You're done! Now come back over the procedure: First, you need to define the bitmap in the resource file. Then, you need to load a bitmap in the program resources, and get a bitmap handle. Then, you need to get a bitmap output area of DC, and the creation of the DC's memory image, and to a bitmap image into the memory DC. Finally the bitmap image copied from the memory DC to DC in the real.
Examples:
.386
. Model flat, stdcall
option casemap: none
include masm32includewindows.inc
include masm32includeuser32.inc
include masm32includekernel32.inc
include masm32includegdi32.inc
includelib masm32libuser32.lib
includelib masm32libkernel32.lib
includelib masm32libgdi32.lib
WinMain proto: DWORD,: DWORD,: DWORD,: DWORD
IDB_MAIN equ 1

. Data
ClassName db "SimpleWin32ASMBitmapClass", 0
AppName db "Win32ASM Simple Bitmap Example", 0

. Data?
hInstance HINSTANCE?
CommandLine LPSTR?
hBitmap dd?

. Code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine
mov CommandLine, eax
invoke WinMain, hInstance, NULL, CommandLine, SW_SHOWDEFAULT
invoke ExitProcess, eax

WinMain proc hInst: HINSTANCE, hPrevInst: HINSTANCE, CmdLine: LPSTR, CmdShow: DWORD
LOCAL wc: WNDCLASSEX
LOCAL msg: MSG
LOCAL hwnd: HWND
mov wc.cbSize, SIZEOF WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
push hInstance
pop wc.hInstance
mov wc.hbrBackground, COLOR_WINDOW +1
mov wc.lpszMenuName, NULL
mov wc.lpszClassName, OFFSET ClassName
invoke LoadIcon, NULL, IDI_APPLICATION
mov wc.hIcon, eax
mov wc.hIconSm, eax
invoke LoadCursor, NULL, IDC_ARROW
mov wc.hCursor, eax
invoke RegisterClassEx, addr wc
INVOKE CreateWindowEx, NULL, ADDR ClassName, ADDR AppName,
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL,
hInst, NULL
mov hwnd, eax
invoke ShowWindow, hwnd, SW_SHOWNORMAL
invoke UpdateWindow, hwnd
. While TRUE
invoke GetMessage, ADDR msg, NULL, 0,0
. Break. If (! Eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
. Endw
mov eax, msg.wParam
ret
WinMain endp

WndProc proc hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM
LOCAL ps: PAINTSTRUCT
LOCAL hdc: HDC
LOCAL hMemDC: HDC
LOCAL rect: RECT
. If uMsg == WM_CREATE
invoke LoadBitmap, hInstance, IDB_MAIN
mov hBitmap, eax
. Elseif uMsg == WM_PAINT
invoke BeginPaint, hWnd, addr ps
mov hdc, eax
invoke CreateCompatibleDC, hdc
mov hMemDC, eax
invoke SelectObject, hMemDC, hBitmap
invoke GetClientRect, hWnd, addr rect
invoke BitBlt, hdc, 0,0, rect.right, rect.bottom, hMemDC, 0,0, SRCCOPY
invoke DeleteDC, hMemDC
invoke EndPaint, hWnd, addr ps
. Elseif uMsg == WM_DESTROY
invoke DeleteObject, hBitmap
invoke PostQuitMessage, NULL
. ELSE
invoke DefWindowProc, hWnd, uMsg, wParam, lParam
ret
. ENDIF
xor eax, eax
ret
WndProc endp
end start

;------------------------------------------------- --------------------
; Resource definitions
;------------------------------------------------- --------------------
# Define IDB_MAIN 1
IDB_MAIN B99vMAP "tweety78.bmp"

Analysis:


# Define IDB_MAIN 1
IDB_MAIN B99vMAP "tweety78.bmp"
Define macro IDB_MAIN integer value of 1, then it points to a resource file in the same directory with the file named "tweety.bmp" bitmap.
. If uMsg == WM_CREATE
invoke LoadBitmap, hInstance, IDB_MAIN
mov hBitmap, eax

In dealing with WM_CREATE message, we pass the API function LoadBitmap loading bitmap resources, and through the function return value to obtain the bitmap handle.
Then, we can place the picture in the window client area.

. Elseif uMsg == WM_PAINT
invoke BeginPaint, hWnd, addr ps
mov hdc, eax
invoke CreateCompatibleDC, hdc
mov hMemDC, eax
invoke SelectObject, hMemDC, hBitmap
invoke GetClientRect, hWnd, addr rect
invoke BitBlt, hdc, 0,0, rect.right, rect.bottom, hMemDC, 0,0, SRCCOPY
invoke DeleteDC, hMemDC
invoke EndPaint, hWnd, addr ps

In this example, we choose in response to WM_PAINT message to draw the bitmap. First we get through the API function l BeginPaint DC client area window handle. Then we created through the API function CreateCompatibleDC memory image of the DC, and through API function SelectObject to bitmap image into memory. Next, we get through the API function GetClientRect the size of the window client area. Finally, we function through the API BitBlt the bitmap image copied from the memory DC to the DC area in the real customers. Finished the work, we release the DC through the API function DeleteDC memory image, with the release of the client area of API functions EndPaint DC, drawing the end of the work.

. Elseif uMsg == WM_DESTROY
invoke DeleteObject, hBitmap
invoke PostQuitMessage, NULL
When we no longer need the bitmap, through the API function DeleteObject to release it.






Recommended links:



Two Errors in the exchange of links



Dell's alliance with AMD vortex effect caused



ps3 XVID



Flv To Ts



TD Commercial Trial On April 1 The Minimum Consumption Of 118 Yuan A Complete Experience



Avchd to mpg



Hot Geography Education



Master is not highly educated does not mean that high-income elite



PHOTOSHOP Production - wire and spark



Good Screen Savers



Charles Zhang said Sohu Sogou do not intend to use the Input method earnings



Matroska video



Sony and NEC will merge the two departments



Wave of mergers BI have a happy life



Wednesday, July 21, 2010

In the title bar of an art form


Very simple, only need to deal with WM_NCPAINT message on the line, that is Windows Message Not Client Paint - non-client area of re-painting, this time drawing can be done in the title bar, another approach is to use GetWindowDC function, this function with GetDC of The only difference is GetWindowDC is to obtain the form of DC, but only access to the client area GetDC DC.





Recommended links:



On the implementation of financial knowledge in the use of



Christmasgift MPEG to MP4



Evaluation Multimedia Creation Tools



Youtube Movie to RMVB Help



Hot Server Applications



Reflection: Dealers genuinely listened to Recruitment



Convert mp4 to avi



dvd RIPPER



Explosion Flash TO iPhone



Converting flac to mp3



comments Shell TOOLS



Youtube Video to 3G2 Professional



format ts



Shanghai foreign manager of the highest pay levels in the national income of over 200 000



Youtube FLV TO Xvid Utility



Monday, March 8, 2010

Cucusoft DVD to PSP Converter pro


Cucusoft DVD to PSP Converter pro is the easiest-to-use and fastest DVD to PSP converter software for Apple PSP Movie and PSP Video. It can convert almost all kinds of DVD to PSP Movie / PSP Video format. It is also a powerful DVD to PSP converter due to the conversion speed is faster than real-time. And the output iPos movie/video supports PSP screen, you can enjoy your favorite DVD on your PSP as a portable DVD Player. And Cucusoft DVD to PSP Converter software also include Cucusoft PSP Movie/Video Converter for free. Now you can get this DVD to PSP Converter at a very competitive price!